00001 // ---------------------------------------------------------------------------- 00002 // CERTI - HLA RunTime Infrastructure 00003 // Copyright (C) 2002-2005 ONERA 00004 // 00005 // This file is part of CERTI-libCERTI 00006 // 00007 // CERTI-libCERTI is free software ; you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License 00009 // as published by the Free Software Foundation ; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but 00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this program ; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 // USA 00021 // 00022 // $Id: Object.hh,v 3.20 2008/12/07 20:16:14 gotthardp Exp $ 00023 // ---------------------------------------------------------------------------- 00024 00025 #ifndef _CERTI_OBJECT_HH 00026 #define _CERTI_OBJECT_HH 00027 00028 // forward declaration 00029 namespace certi { 00030 class ObjectAttribute; 00031 class RTIRegion; 00032 } 00033 00034 #include "certi.hh" 00035 #include "Named.hh" 00036 #include "Handled.hh" 00037 #include "Exception.hh" 00038 00039 #include <deque> 00040 #include <list> 00041 00042 namespace certi { 00043 00044 class CERTI_EXPORT Object : public Named, public Handled<ObjectHandle> 00045 { 00046 public: 00047 Object(FederateHandle the_owner) 00048 : Owner(the_owner), name("") { handle = 0 ; }; 00049 00050 Object(FederateHandle the_owner, const char *the_name); 00051 00052 virtual ~Object(); 00053 00054 void display() const ; 00055 00056 void addAttribute(ObjectAttribute * new_attribute); 00057 ObjectAttribute *getAttribute(AttributeHandle the_attribute) const 00058 throw (AttributeNotDefined); 00059 00060 bool isAttributeOwnedByFederate(FederateHandle, AttributeHandle) const 00061 throw (AttributeNotDefined, RTIinternalError); 00062 00063 ObjectClassHandle getClass() const ; 00064 void setClass(ObjectClassHandle h); 00065 00066 FederateHandle getOwner() const ; 00067 void setOwner(FederateHandle); 00068 00069 void unassociate(RTIRegion *); 00070 00071 // ----------------------- 00072 // -- Public Attributes -- 00073 // ---------------------- 00077 FederateHandle Owner ; 00078 00079 private: 00081 std::deque<ObjectAttribute *> attributeState ; 00082 00083 ObjectHandle handle ; 00084 ObjectClassHandle classHandle ; 00085 ObjectName_t name ; 00086 00090 std::list<FederateHandle *> sf ; 00091 }; 00092 00093 } 00094 00095 #endif // _CERTI_OBJECT_HH 00096 00097 // $Id: Object.hh,v 3.20 2008/12/07 20:16:14 gotthardp Exp $