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: ObjectAttribute.hh,v 3.17 2008/12/07 20:16:14 gotthardp Exp $ 00023 // ---------------------------------------------------------------------------- 00024 00025 #ifndef CERTI_OBJECT_ATTRIBUTE_HH 00026 #define CERTI_OBJECT_ATTRIBUTE_HH 00027 00028 #include "certi.hh" 00029 #include "Exception.hh" 00030 00031 #include <list> 00032 00033 namespace certi { 00034 00035 class RTIRegion ; 00036 00037 class ObjectClassAttribute ; 00038 00040 00046 class CERTI_EXPORT ObjectAttribute { 00047 00048 public: 00049 // Public Methods 00050 00051 // Constructors & Destructors 00052 ObjectAttribute(); 00053 ObjectAttribute(AttributeHandle, FederateHandle, ObjectClassAttribute *); 00054 ~ObjectAttribute(); 00055 00056 void display() const ; 00057 00058 FederateHandle getOwner() const ; 00059 void setOwner(FederateHandle NewOwner); 00060 00061 void setDivesting(bool divesting_state); 00062 bool beingDivested() const ; 00063 00064 int isCandidate(FederateHandle candidate) const ; 00065 void addCandidate(FederateHandle candidate); 00066 void removeCandidate(FederateHandle candidate); 00067 FederateHandle getCandidate(unsigned int) const throw (RTIinternalError); 00068 bool hasCandidates() const ; 00069 00070 AttributeHandle getHandle() const ; 00071 void setHandle(AttributeHandle h); 00072 00073 SpaceHandle getSpace() const ; 00074 void setSpace(SpaceHandle); 00075 00076 ObjectClassAttribute *getObjectClassAttribute() const { return source ; }; 00077 00078 void associate(RTIRegion *); 00079 void unassociate(RTIRegion *); 00080 00081 const RTIRegion *getRegion() const { return region ; }; 00082 00083 private: 00084 // Private Attributes 00085 AttributeHandle handle ; 00086 FederateHandle owner ; 00087 bool divesting ; 00088 std::list<FederateHandle> ownerCandidates ; 00089 SpaceHandle space ; 00090 ObjectClassAttribute *source ; 00091 RTIRegion *region ; 00092 }; 00093 00094 } 00095 00096 #endif // CERTI_OBJECT_ATTRIBUTE_HH 00097 00098 // $Id: ObjectAttribute.hh,v 3.17 2008/12/07 20:16:14 gotthardp Exp $