# ObjectClassSet.hh

Go to the documentation of this file.

    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: ObjectClassSet.hh,v 3.36 2008/11/08 11:36:04 erk Exp $
    00023 // ----------------------------------------------------------------------------
    00024
    00025 #ifndef _CERTI_OBJECT_CLASS_SET_HH
    00026 #define _CERTI_OBJECT_CLASS_SET_HH
    00027
    00028 // forward declaration
    00029 namespace certi {
    00030 class Object;
    00031 class SecurityServer;
    00032 }  // namespace certi
    00033
    00034 // CERTI headers
    00035 #include "certi.hh"
    00036 #include "ObjectClass.hh"
    00037 #include "TreeNamedAndHandledSet.hh"
    00038
    00039 // System headers
    00040 #include <list>
    00041 #include <string>
    00042 #include <map>
    00043
    00044 namespace certi {
    00045
    00049 class CERTI_EXPORT ObjectClassSet : public TreeNamedAndHandledSet<ObjectClass>
    00050 {
    00051
    00052 public:
    00053     ObjectClassSet(SecurityServer *theSecurityServer, bool isRootClassSet=false);
    00054     ~ObjectClassSet();
    00055
    00061     void addClass(ObjectClass *theClass,ObjectClass *parentClass) throw (RTIinternalError);
    00062
    00063     // RTI Support Services
    00064     AttributeHandle getAttributeHandle(const char *the_name,
    00065             ObjectClassHandle the_class) const
    00066             throw (NameNotFound, ObjectClassNotDefined, RTIinternalError);
    00067
    00068     const char *getAttributeName(AttributeHandle the_handle,
    00069             ObjectClassHandle the_class) const
    00070             throw (AttributeNotDefined, ObjectClassNotDefined, RTIinternalError);
    00071
    00072     ObjectClassHandle getObjectClassHandle(std::string) const
    00073     throw (NameNotFound);
    00074
    00075     std::string getObjectClassName(ObjectClassHandle the_handle) const
    00076     throw (ObjectClassNotDefined);
    00077
    00078     void killFederate(FederateHandle theFederate)
    00079     throw ();
    00080
    00081     // Object Class Management
    00082     void publish(FederateHandle theFederateHandle,
    00083             ObjectClassHandle theClassHandle,
    00084             std::vector <AttributeHandle> &theAttributeList,
    00085             UShort theListSize,
    00086             bool PubOrUnpub)
    00087     throw (ObjectClassNotDefined, AttributeNotDefined, RTIinternalError,
    00088             SecurityError);
    00089
    00090     void subscribe(FederateHandle, ObjectClassHandle, std::vector <AttributeHandle> &,
    00091             int theListSize, const RTIRegion * = 0)
    00092     throw (ObjectClassNotDefined, AttributeNotDefined, RTIinternalError,
    00093             SecurityError);
    00094
    00095     // Object Instance Management
    00096     void deleteObject(FederateHandle theFederateHandle,
    00097             ObjectHandle theObjectHandle,
    00098             FederationTime theTime,
    00099             std::string theTag)
    00100     throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
    00101
    00102     void deleteObject(FederateHandle theFederateHandle,
    00103             ObjectHandle theObjectHandle,
    00104             std::string theTag)
    00105     throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
    00106
    00107     void registerObjectInstance(FederateHandle, Object *, ObjectClassHandle)
    00108     throw (InvalidObjectHandle, ObjectClassNotDefined,
    00109             ObjectClassNotPublished, ObjectAlreadyRegistered,
    00110             RTIinternalError);
    00111
    00112     void updateAttributeValues(FederateHandle theFederateHandle,
    00113             ObjectHandle theObjectHandle,
    00114             std::vector <AttributeHandle> &theAttribArray,
    00115             std::vector <AttributeValue_t> &theValueArray,
    00116             UShort theArraySize,
    00117             FederationTime theTime,
    00118             const char *theUserTag)
    00119     throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
    00120             RTIinternalError, InvalidObjectHandle);
    00121
    00122     void updateAttributeValues(FederateHandle theFederateHandle,
    00123             ObjectHandle theObjectHandle,
    00124             std::vector <AttributeHandle> &theAttribArray,
    00125             std::vector <AttributeValue_t> &theValueArray,
    00126             UShort theArraySize,
    00127             const char *theUserTag)
    00128     throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
    00129             RTIinternalError, InvalidObjectHandle);
    00130
    00131
    00132     // Ownership Management
    00133     void negotiatedAttributeOwnershipDivestiture(FederateHandle,
    00134             ObjectHandle theObjectHandle,
    00135             std::vector <AttributeHandle> &,
    00136             UShort theListSize,
    00137             const char *theTag)
    00138     throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
    00139             AttributeAlreadyBeingDivested, RTIinternalError);
    00140
    00141
    00142     void attributeOwnershipAcquisitionIfAvailable(FederateHandle,
    00143             ObjectHandle theObjectHandle,
    00144             std::vector <AttributeHandle>&,
    00145             UShort theListSize)
    00146     throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined,
    00147             AttributeNotPublished, FederateOwnsAttributes,
    00148             AttributeAlreadyBeingAcquired, RTIinternalError);
    00149
    00150     void unconditionalAttributeOwnershipDivestiture(FederateHandle,
    00151             ObjectHandle,
    00152             std::vector <AttributeHandle>&,
    00153             UShort theListSize)
    00154     throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
    00155             RTIinternalError);
    00156
    00157     void attributeOwnershipAcquisition(FederateHandle theFederateHandle,
    00158             ObjectHandle theObjectHandle,
    00159             std::vector <AttributeHandle> &theAttributeList,
    00160             UShort theListSize,
    00161             const char *theTag)
    00162     throw (ObjectNotKnown, ObjectClassNotPublished, AttributeNotDefined,
    00163             AttributeNotPublished, FederateOwnsAttributes, RTIinternalError);
    00164
    00165     AttributeHandleSet *attributeOwnershipReleaseResponse(FederateHandle,
    00166             ObjectHandle,
    00167             std::vector <AttributeHandle> &,
    00168             UShort)
    00169     throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
    00170             FederateWasNotAskedToReleaseAttribute, RTIinternalError);
    00171
    00172     void cancelAttributeOwnershipAcquisition(FederateHandle theFederateHandle,
    00173             ObjectHandle theObjectHandle,
    00174             std::vector <AttributeHandle> &theAttributeList,
    00175             UShort theListSize)
    00176     throw (ObjectNotKnown, AttributeNotDefined, AttributeAlreadyOwned,
    00177             AttributeAcquisitionWasNotRequested, RTIinternalError);
    00178
    00179     Object *getObject(ObjectHandle) const throw (ObjectNotKnown);
    00180
    00181 private:
    00182
    00187     SecurityServer *server ;
    00188
    00189     ObjectClass *getInstanceClass(ObjectHandle theObjectHandle) const
    00190     throw (ObjectNotKnown);
    00191 };
    00192
    00193 } // namespace certi
    00194
    00195 #endif // _CERTI_OBJECT_CLASS_SET_HH
    00196
    00197 // $Id: ObjectClassSet.hh,v 3.36 2008/11/08 11:36:04 erk Exp $