# RootObject.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: RootObject.hh,v 3.32 2008/11/08 11:08:03 erk Exp $
    00023 // ----------------------------------------------------------------------------
    00024
    00025 #ifndef LIBCERTI_ROOT_OBJECT
    00026 #define LIBCERTI_ROOT_OBJECT
    00027
    00028 // forward declaration
    00029 namespace certi {
    00030     class Object;
    00031     class ObjectSet;
    00032     class ObjectAttribute;
    00033     class ObjectClass;
    00034     class ObjectClassSet;
    00035     class ObjectClassAttribute;
    00036     class Interaction;
    00037     class InteractionSet;
    00038     class RTIRegion;
    00039     class RoutingSpace;
    00040 }  // namespace certi
    00041
    00042 #include "certi.hh"
    00043 #include "SecurityServer.hh"
    00044 #include "HandleManager.hh"
    00045 #include "RoutingSpace.hh"
    00046
    00047 #include <vector>
    00048
    00049 namespace certi {
    00050
    00062 class CERTI_EXPORT RootObject
    00063 {
    00064 public:
    00065
    00072     RootObject(SecurityServer *security_server);
    00073
    00078     ~RootObject();
    00079
    00080     void display() const;
    00081
    00089     SecurityLevelID getSecurityLevelID(const std::string& levelName);
    00090
    00091     void registerFederate(const std::string& the_federate,
    00092                           SecurityLevelID the_level_id);
    00093
    00094     // Data Distribution Management
    00095     void addRoutingSpace(const RoutingSpace &);
    00096     RoutingSpace &getRoutingSpace(SpaceHandle) throw (SpaceNotDefined);
    00097     SpaceHandle getRoutingSpaceHandle(std::string) throw (NameNotFound);
    00098     std::string getRoutingSpaceName(SpaceHandle) throw (SpaceNotDefined);
    00099
    00100     void addRegion(RTIRegion *);
    00101     RegionHandle createRegion(SpaceHandle, unsigned long) throw (SpaceNotDefined);
    00102     void deleteRegion(RegionHandle) throw (RegionNotKnown, RegionInUse);
    00103     RTIRegion *getRegion(RegionHandle) throw (RegionNotKnown);
    00104     void modifyRegion(RegionHandle, const std::vector<Extent> &)
    00105     throw (RegionNotKnown, InvalidExtents);
    00106
    00107     // Object Management
    00108     void registerObjectInstance(FederateHandle, ObjectClassHandle, ObjectHandle,
    00109                                 const char *)
    00110         throw (InvalidObjectHandle,
    00111                ObjectClassNotDefined,
    00112                ObjectClassNotPublished,
    00113                ObjectAlreadyRegistered,
    00114                RTIinternalError);
    00115
    00116     FederateHandle requestObjectOwner(FederateHandle theFederateHandle, ObjectHandle theObject)
    00117         throw (ObjectNotKnown);
    00118
    00119     void deleteObjectInstance(FederateHandle, ObjectHandle,
    00120                       FederationTime theTime, std::string theTag)
    00121         throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
    00122
    00123     void deleteObjectInstance(FederateHandle, ObjectHandle, std::string theTag)
    00124         throw (DeletePrivilegeNotHeld, ObjectNotKnown, RTIinternalError);
    00125
    00126     void killFederate(FederateHandle) throw (RTIinternalError);
    00127
    00128     // Access to elements of the RootObject hierarchy
    00129     ObjectAttribute *getObjectAttribute(ObjectHandle, AttributeHandle);
    00130     ObjectClass *getObjectClass(ObjectClassHandle);
    00131     Interaction *getInteractionClass(InteractionClassHandle);
    00132     Object *getObject(ObjectHandle);
    00133     ObjectClassAttribute *getObjectClassAttribute(ObjectHandle,
    00134                           AttributeHandle);
    00135
    00142     void addObjectClass(ObjectClass* currentOC,ObjectClass* parentOC);
    00143
    00150     void addInteractionClass(Interaction* currentIC, Interaction* parentIC);
    00151
    00156     ObjectClassSet *ObjectClasses;
    00157
    00162     InteractionSet *Interactions;
    00163
    00167     ObjectSet      *objects;
    00168
    00169 private:
    00170
    00171     std::vector<RoutingSpace> spaces;
    00175     SecurityServer           *server;
    00176
    00177     // Regions
    00178     std::list<RTIRegion *> regions ;
    00179     HandleManager<RegionHandle> regionHandles ;
    00180 };
    00181
    00182 } // namespace certi
    00183
    00184 #endif // LIBCERTI_ROOT_OBJECT
    00185
    00186 // $Id: RootObject.hh,v 3.32 2008/11/08 11:08:03 erk Exp $