# ObjectClassAttribute.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: ObjectClassAttribute.hh,v 3.26 2008/12/16 07:08:29 approx Exp $
    00023 // ----------------------------------------------------------------------------
    00024
    00025 #ifndef CERTI_OBJECT_CLASS_ATTRIBUTE_HH
    00026 #define CERTI_OBJECT_CLASS_ATTRIBUTE_HH
    00027
    00028 // forward declarations
    00029 namespace certi {
    00030     class ObjectClassBroadcastList;
    00031     class RTIRegion;
    00032     class SecurityServer;
    00033 }  // namespace certi
    00034
    00035 // CERTI headers
    00036 #include "certi.hh"
    00037 #include "SecurityLevel.hh"
    00038 #include "Subscribable.hh"
    00039
    00040 #include <set>
    00041
    00042 namespace certi {
    00043
    00048 class CERTI_EXPORT ObjectClassAttribute : public Subscribable {
    00049
    00050 public:
    00055     typedef std::set<FederateHandle> PublishersList_t;
    00056
    00057     ObjectClassAttribute(const std::string theName, TransportType theTransport, OrderType theOrder);
    00058     ObjectClassAttribute(ObjectClassAttribute *source);
    00059     virtual ~ObjectClassAttribute();
    00060
    00061     void display() const ;
    00062
    00063     void setHandle(AttributeHandle h);
    00064     AttributeHandle getHandle() const ;
    00065
    00066     void setSpace(SpaceHandle);
    00067     SpaceHandle getSpace() const ;
    00068
    00069     // Security methods
    00070     virtual void checkFederateAccess(FederateHandle the_federate, const char *reason) const ;
    00071
    00072     // Publish methods
    00073     bool isPublishing(FederateHandle) const ;
    00074     void publish(FederateHandle) throw (RTIinternalError, SecurityError);
    00075     void unpublish(FederateHandle) throw (RTIinternalError, SecurityError);
    00076
    00077     // Update attribute values
    00078     void updateBroadcastList(ObjectClassBroadcastList *ocb_list,
    00079                  const RTIRegion *region = 0);
    00080
    00085     PublishersList_t getPublishers(void);
    00086
    00087     // Attributes
    00088     SecurityLevelID level ;
    00089     OrderType order ;
    00090     TransportType transport ;
    00091     SecurityServer *server ;
    00092
    00093 private:
    00094     /*
    00095      * private default constructor with no code
    00096      * one should not call it.
    00097      */
    00098     ObjectClassAttribute();
    00099     void deletePublisher(FederateHandle);
    00100
    00101     AttributeHandle handle ;
    00102     SpaceHandle space ;
    00103
    00104     PublishersList_t publishers ;
    00105 };
    00106
    00107 } // namespace
    00108
    00109 #endif // CERTI_OBJECT_CLASS_ATTRIBUTE_HH
    00110
    00111 // $Id: ObjectClassAttribute.hh,v 3.26 2008/12/16 07:08:29 approx Exp $