# GAV.hh

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2002-2005  ONERA
    00004 //
    00005 // This program is free software ; you can redistribute it and/or
    00006 // modify it under the terms of the GNU Lesser General Public License
    00007 // as published by the Free Software Foundation ; either version 2 of
    00008 // the License, or (at your option) any later version.
    00009 //
    00010 // This program is distributed in the hope that it will be useful, but
    00011 // WITHOUT ANY WARRANTY ; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00013 // Lesser General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU Lesser General Public
    00016 // License along with this program ; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    00018 // ----------------------------------------------------------------------------
    00019
    00020 #ifndef CERTI_GAV_HH
    00021 #define CERTI_GAV_HH
    00022
    00023 #include "certi.hh"
    00024 #include "Exception.hh"
    00025
    00026 #include <list>
    00027
    00028 namespace certi {
    00029
    00030 class CERTI_EXPORT AttributeHandleSet
    00031 {
    00032 public:
    00033     AttributeHandleSet(ULong size);
    00034     virtual ~AttributeHandleSet();
    00035
    00036     virtual ULong size() const ;
    00037
    00038     virtual AttributeHandle getHandle(ULong i) const
    00039         throw (ArrayIndexOutOfBounds);
    00040
    00041     virtual void add(AttributeHandle h)
    00042         throw (ArrayIndexOutOfBounds, AttributeNotDefined);
    00043
    00044     virtual void remove(AttributeHandle h)
    00045         throw (AttributeNotDefined);
    00046
    00047     virtual void empty();
    00048
    00049     virtual bool isEmpty() const ;
    00050     virtual bool isMember(AttributeHandle h) const ;
    00051
    00052 protected:
    00053     std::list<AttributeHandle> _set;
    00054 };
    00055
    00056 class FederateHandleSet
    00057 {
    00058 public:
    00059     FederateHandleSet(ULong size);
    00060     virtual ~FederateHandleSet();
    00061
    00062     virtual ULong size() const ;
    00063
    00064     virtual FederateHandle getHandle(ULong i) const
    00065         throw (ArrayIndexOutOfBounds);
    00066
    00067     virtual void add(FederateHandle h)
    00068         throw (ValueCountExceeded);
    00069
    00070     virtual void remove(FederateHandle h)
    00071         throw (ArrayIndexOutOfBounds);
    00072
    00073     virtual void empty();
    00074
    00075     virtual bool isMember(FederateHandle h) const ;
    00076
    00077 protected:
    00078     std::list<FederateHandle> _set;
    00079 };
    00080
    00081 class AttributeHandleValuePair
    00082 {
    00083     // ATTRIBUTES
    00084 public:
    00085     Handle _handle ;
    00086     ULong _valueLength ;
    00087     char *_value ;
    00088
    00089     // METHODS
    00090 public :
    00091     AttributeHandleValuePair(Handle handle,
    00092                              const char *value,
    00093                              ULong value_length);
    00094     ~AttributeHandleValuePair();
    00095 };
    00096
    00097 class AttributeHandleValuePairSet
    00098 {
    00099     // ATTRIBUTES
    00100 public:
    00101     OrderType _order ;
    00102     TransportType _transport ;
    00103
    00104     // METHODS
    00105 public:
    00106     AttributeHandleValuePairSet(ULong size);
    00107     virtual ~AttributeHandleValuePairSet();
    00108
    00109     virtual ULong size() const ;
    00110     virtual Handle getHandle(ULong i) const throw (ArrayIndexOutOfBounds);
    00111     virtual ULong getValueLength(ULong i) const throw (ArrayIndexOutOfBounds);
    00112
    00113     virtual void getValue(ULong i, char *buff, ULong& valueLength) const
    00114         throw (ArrayIndexOutOfBounds);
    00115
    00116     virtual char *getValuePointer(ULong i, ULong& valueLength) const
    00117         throw (ArrayIndexOutOfBounds);
    00118
    00119     virtual TransportType getTransportType(ULong i) const
    00120         throw (InvalidHandleValuePairSetContext);
    00121
    00122     virtual OrderType getOrderType(ULong i) const
    00123         throw (ArrayIndexOutOfBounds, InvalidHandleValuePairSetContext);
    00124
    00125     virtual void add(Handle h, const char *buff, ULong valueLength)
    00126         throw (ValueLengthExceeded, ValueCountExceeded);
    00127     virtual void remove(Handle h) throw (ArrayIndexOutOfBounds);
    00128
    00129     virtual void moveFrom(const AttributeHandleValuePairSet& ahvps, ULong& i)
    00130         throw (ValueCountExceeded, ArrayIndexOutOfBounds);
    00131
    00132     virtual void empty();
    00133     virtual ULong start() const ;
    00134     virtual ULong valid(ULong i) const ;
    00135     virtual ULong next(ULong i) const ;
    00136
    00137 protected:
    00138     std::list<AttributeHandleValuePair *> _set;
    00139 };
    00140
    00141 class ParameterHandleValuePair
    00142 {
    00143 public:
    00144     Handle _handle ;
    00145     ULong _valueLength ;
    00146     char *_value ;
    00147
    00148     ParameterHandleValuePair(Handle handle, const char *value, ULong length);
    00149     ~ParameterHandleValuePair();
    00150 };
    00151
    00152 class ParameterHandleValuePairSet
    00153 {
    00154 public:
    00155     OrderType _order ;
    00156     TransportType _transport ;
    00157
    00158 public:
    00159     ParameterHandleValuePairSet(ULong size);
    00160     virtual ~ParameterHandleValuePairSet();
    00161
    00162     virtual ULong size() const ;
    00163
    00164     virtual Handle getHandle(ULong i) const throw (ArrayIndexOutOfBounds);
    00165
    00166     virtual ULong getValueLength(ULong i) const throw (ArrayIndexOutOfBounds);
    00167
    00168     virtual void getValue(ULong i, char *buff, ULong& valueLength) const
    00169         throw (ArrayIndexOutOfBounds);
    00170
    00171     virtual char *getValuePointer(ULong i, ULong& valueLength) const
    00172         throw (ArrayIndexOutOfBounds);
    00173
    00174     virtual TransportType getTransportType() const
    00175         throw (InvalidHandleValuePairSetContext);
    00176
    00177     virtual OrderType getOrderType() const
    00178         throw (InvalidHandleValuePairSetContext);
    00179
    00180     virtual void add(Handle h, const char *buff, ULong valueLength)
    00181         throw (ValueLengthExceeded, ValueCountExceeded);
    00182
    00183     virtual void remove(Handle h) throw (ArrayIndexOutOfBounds);
    00184
    00185     virtual void moveFrom(const ParameterHandleValuePairSet& phvps, ULong& i)
    00186         throw (ValueCountExceeded, ArrayIndexOutOfBounds);
    00187
    00188     virtual void empty();
    00189     virtual ULong start() const ;
    00190     virtual ULong valid(ULong i) const ;
    00191     virtual ULong next(ULong i) const ;
    00192
    00193 protected:
    00194     std::list<ParameterHandleValuePair *> _set;
    00195 };
    00196
    00197 } // namespace certi
    00198
    00199 #endif // CERTI_GAV_HH