00001 /* 00002 * MARIE - Mobile and Autonomous Robotics Integration Environment 00003 * Copyright (C) 2004 Carle Cote 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * You can contact MARIE development team at http://marie.sourceforge.net 00020 */ 00021 00022 // 00023 // C++ Interface: MARIEObject 00024 // 00025 // Description: 00026 // 00027 // 00028 // Author: Dominic Letourneau <dominic@laborius.org>, (C) 2004 00029 // 00030 // Copyright: See COPYING file that comes with this distribution 00031 // 00032 // 00033 // Prevent Multiple Inclusion 00034 #ifndef _MARIE_OBJECT_H_ 00035 #define _MARIE_OBJECT_H_ 00036 00037 #include "Object.h" 00038 #include "DataAbstract.h" 00039 00040 namespace marie 00041 { 00042 class MarieObject : public FD::Object 00043 { 00044 00045 public: 00046 00047 MarieObject() {}; 00048 MarieObject(DataAbstract *data); 00049 ~MarieObject(); 00050 00051 DataAbstract* getData(); 00052 00053 virtual void printOn(std::ostream &out) const; 00054 virtual void readFrom(std::istream &in=std::cin); 00055 // virtual void copyDataAbstract(DataAbstract *data); 00056 00057 00058 protected: 00059 DataAbstract *m_data; 00060 // MarieObject(const C &marieObject) 00061 // : C(marieObject) 00062 // { 00063 // 00064 // } 00065 // 00066 // virtual void MarieObject::printOn(std::ostream &out) const 00067 // { 00068 // MarieXMLDataFactory factory; 00069 // 00070 // //writing XML data 00071 // string value = factory.toString((CommandBehavior) (*this)); 00072 // 00073 // out.write(value.c_str(), value.size()); 00074 // } 00075 // 00076 // virtual void readFrom(std::istream &in=std::cin) 00077 // { 00078 // throw new GeneralException("readFrom not supported for type : " + C::ID + " Use the MariePull Node to read data from the stream.",__FILE__,__LINE__); 00079 // } 00080 // 00081 // virtual void copyDataAbstract(DataAbstract *data) 00082 // { 00083 // if (data) 00084 // { 00085 // C *marieObjectPtr = dynamic_cast<C*>(data); 00086 // if (marieObjectPtr) 00087 // { 00088 // this->C::operator=(*marieObjectPtr); 00089 // } 00090 // else 00091 // { 00092 // throw new GeneralException(string("Unable to cast into" + C::ID + " Abstract : ") + data->getID(),__FILE__,__LINE__); 00093 // } 00094 // } 00095 // } 00096 00097 }; 00098 } 00099 #endif