[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi libCERTI/BaseRegion.hh libCERTI/Message.c...
From: |
CERTI CVS commits |
Subject: |
[certi-cvs] certi libCERTI/BaseRegion.hh libCERTI/Message.c... |
Date: |
Tue, 24 Sep 2013 14:46:22 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 13/09/24 14:46:22
Added files:
libCERTI : BaseRegion.hh Message.cc HandleManager.hh
NameReservation.hh
include : RTI.hh federateAmbServices.hh
Log message:
Re-add files that were wrongly suppressed
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/BaseRegion.hh?cvsroot=certi&rev=3.5
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.cc?cvsroot=certi&rev=3.70
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/HandleManager.hh?cvsroot=certi&rev=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NameReservation.hh?cvsroot=certi&rev=3.4
http://cvs.savannah.gnu.org/viewcvs/certi/include/RTI.hh?cvsroot=certi&rev=3.22
http://cvs.savannah.gnu.org/viewcvs/certi/include/federateAmbServices.hh?cvsroot=certi&rev=3.3
Patches:
Index: libCERTI/BaseRegion.hh
===================================================================
RCS file: libCERTI/BaseRegion.hh
diff -N libCERTI/BaseRegion.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libCERTI/BaseRegion.hh 24 Sep 2013 14:46:21 -0000 3.5
@@ -0,0 +1,72 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005 ONERA
+//
+// This file is part of CERTI-libRTI
+//
+// CERTI-libRTI is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// CERTI-libRTI is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// ----------------------------------------------------------------------------
+
+#ifndef CERTI_BASE_REGION_HH
+#define CERTI_BASE_REGION_HH
+
+#include "Extent.hh"
+#include "Handled.hh"
+
+#include <vector>
+
+namespace certi {
+
+typedef Handle RegionHandle ;
+
+class CERTI_EXPORT BaseRegion : public Handled<RegionHandle>
+{
+public:
+ BaseRegion(RegionHandle);
+ virtual ~BaseRegion();
+
+ virtual uint32_t getRangeLowerBound(ExtentIndex, DimensionHandle) const
+ throw (ArrayIndexOutOfBounds);
+
+ virtual uint32_t getRangeUpperBound(ExtentIndex, DimensionHandle) const
+ throw (ArrayIndexOutOfBounds);
+
+ virtual void setRangeLowerBound(ExtentIndex, DimensionHandle, uint32_t)
+ throw (ArrayIndexOutOfBounds);
+
+ virtual void setRangeUpperBound(ExtentIndex, DimensionHandle, uint32_t)
+ throw (ArrayIndexOutOfBounds);
+
+ virtual uint32_t getNumberOfExtents() const
+ throw ();
+
+ virtual SpaceHandle getSpaceHandle() const
+ throw () = 0 ;
+
+ const std::vector<Extent> &getExtents() const ;
+ void replaceExtents(const std::vector<Extent> &) throw (InvalidExtents);
+ bool overlaps(const BaseRegion ®ion) const ;
+
+protected:
+ void setExtents(const std::vector<Extent> &);
+
+ std::vector<Extent> extents ;
+};
+
+} // namespace certi
+
+#endif // CERTI_BASE_REGION_HH
Index: libCERTI/Message.cc
===================================================================
RCS file: libCERTI/Message.cc
diff -N libCERTI/Message.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libCERTI/Message.cc 24 Sep 2013 14:46:21 -0000 3.70
@@ -0,0 +1,59 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005 ONERA
+//
+// This program is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// ----------------------------------------------------------------------------
+
+#include "Message.hh"
+#include "certi.hh"
+#include "PrettyDebug.hh"
+
+#include <stdlib.h>
+#include <cstdio>
+#include <cstring>
+#include <assert.h>
+
+using std::vector ;
+
+namespace certi {
+
+static PrettyDebug G("GENDOC",__FILE__) ;
+
+Message::Message()
+{
+ exception = e_NO_EXCEPTION ;
+ exceptionReason = "" ;
+ messageName = "Message (generic)";
+ type = NOT_USED ;
+ resignAction = certi::NO_ACTION ;
+ space = 0 ;
+ dimension = 0 ;
+} /* end of Message default constructor */
+
+// ----------------------------------------------------------------------------
+/** Store exception into message
+ @param the_exception : exception type (enum)
+ @param the_reason : exception reason
+*/
+void
+Message::setException(TypeException the_exception,
+ const std::string& the_reason)
+{
+ exception = the_exception ;
+ exceptionReason = the_reason;
+}
+
+} // namespace certi
Index: libCERTI/HandleManager.hh
===================================================================
RCS file: libCERTI/HandleManager.hh
diff -N libCERTI/HandleManager.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libCERTI/HandleManager.hh 24 Sep 2013 14:46:21 -0000 3.10
@@ -0,0 +1,117 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2002-2005 ONERA
+//
+// This program is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// ----------------------------------------------------------------------------
+
+#ifndef LIBCERTI_HANDLE_MANAGER
+#define LIBCERTI_HANDLE_MANAGER
+
+#include "certi.hh"
+
+#include <limits>
+
+namespace certi {
+
+/**
+ * Manage a set of handles ('provide' and 'free' services). Freed
+ * handles may be provided again in a future request.
+ */
+template<typename T>
+class HandleManager
+{
+public:
+ /**
+ * Constructor with init value.
+ * The default maximal value will be based on the type max given
+ * by numeric_limits traits.
+ * @param[in] init Initial handle value (use for first requested handle)
+ */
+ HandleManager(T);
+ /**
+ * Constructor with init value and max.
+ * @param[in] init Initial handle value (use for first requested handle)
+ * @param[in] hmax Maximal handle value
+ */
+ HandleManager(T init, size_t hmax);
+ /**
+ * Provide a new unique federation execution-wide handle.
+ * IEEE-1516.1-2000 - 10.1.1 Names says:
+ * "Each name in an FDD (object classes, interactions, attributes,
+ * parameters, dimensions, transportation types, order types)
+ * shall have a unique, and unpredictable, federation execution-wide
handle."
+ *
+ * @return the new handle
+ * @throw RTIinternalError if all handles between first and maximal are
used
+ */
+ T provide() throw (RTIinternalError);
+
+ /**
+ * Free a handle.
+ * @pre handle is a previously-provided handle
+ * @param handle Handle to free
+ * @todo CHECK how this could be handled, currently free does nothing!
+ */
+ void free(T handle);
+
+private:
+ size_t maximum ;
+ T highest ;
+ std::list<T> available ;
+};
+
+
+template<typename T>
+HandleManager<T>::HandleManager(T init)
+: maximum(std::numeric_limits<T>::max()), highest(init) { }
+
+template<typename T>
+HandleManager<T>::HandleManager(T init, size_t hmax)
+: highest(init), maximum(hmax) { }
+
+template<typename T> T
+HandleManager<T>::provide() throw (RTIinternalError)
+{
+ T handle = 0 ;
+
+ if (available.size() > 0) {
+ handle = available.front();
+ available.pop_front();
+ }
+ else {
+ if (highest < maximum)
+ handle = highest++ ;
+ else
+ throw RTIinternalError("Maximum handle reached");
+ }
+
+ return handle ;
+} /* end of provide */
+
+template<typename T> void
+HandleManager<T>::free(T handle)
+{
+ //if (handle + 1 == highest)
+ //--highest ;
+ //else
+ //available.push_back(handle);
+}
+
+} // certi
+
+#endif // LIBCERTI_HANDLE_MANAGER
Index: libCERTI/NameReservation.hh
===================================================================
RCS file: libCERTI/NameReservation.hh
diff -N libCERTI/NameReservation.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libCERTI/NameReservation.hh 24 Sep 2013 14:46:21 -0000 3.4
@@ -0,0 +1,54 @@
+// ----------------------------------------------------------------------------
+// CERTI - HLA RunTime Infrastructure
+// Copyright (C) 2004 ONERA
+//
+// This file is part of CERTI-libCERTI
+//
+// CERTI-libCERTI is free software ; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public License
+// as published by the Free Software Foundation ; either version 2 of
+// the License, or (at your option) any later version.
+//
+// CERTI-libCERTI is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY ; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program ; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+// ----------------------------------------------------------------------------
+
+#ifndef LIBCERTI_NAME_RESERVATION_HH
+#define LIBCERTI_NAME_RESERVATION_HH
+
+#include <map>
+#include "certi.hh"
+#include "Named.hh"
+#include "Handled.hh"
+
+namespace certi {
+
+class NameReservation;
+
+typedef std::map<std::string, NameReservation *> NameReservationSet;
+
+class CERTI_EXPORT NameReservation : public Named, public
Handled<FederateHandle>
+{
+public:
+ NameReservation(FederateHandle the_owner, std::string the_name)
+ : Named(the_name)
+ , Handled<FederateHandle>(the_owner)
+ {
+ }
+
+ virtual ~NameReservation()
+ {
+ }
+
+};
+
+} // namespace certi
+#endif // LIBCERTI_NAME_RESERVATION_HH
Index: include/RTI.hh
===================================================================
RCS file: include/RTI.hh
diff -N include/RTI.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ include/RTI.hh 24 Sep 2013 14:46:22 -0000 3.22
@@ -0,0 +1,99 @@
+// HLA 1.3 Header "RTI.hh"
+
+#ifndef RTI_hh
+#define RTI_hh
+
+#if defined(_WIN32) || defined(__CYGWIN__)
+ #pragma warning(disable: 4290)
+ #pragma warning(disable: 4275)
+ #pragma warning(disable: 4251)
+ #pragma warning(disable: 4273)
+ #pragma warning(disable: 4996)
+ #define ANY_DLL_EXPORT __declspec(dllexport)
+ #define ANY_DLL_IMPORT __declspec(dllimport)
+ #define ANY_DLL_LOCAL
+#else
+ #if (__GNUC__ >= 4)
+ #define ANY_DLL_EXPORT __attribute__ ((visibility("default")))
+ #define ANY_DLL_IMPORT __attribute__ ((visibility("default")))
+ #define ANY_DLL_LOCAL __attribute__ ((visibility("hidden")))
+ #else
+ #define ANY_DLL_EXPORT
+ #define ANY_DLL_IMPORT
+ #define ANY_DLL_LOCAL
+ #endif
+#endif
+
+#if defined(RTI_EXPORTS)
+ #define RTI_EXPORT ANY_DLL_EXPORT
+#else
+ #define RTI_EXPORT ANY_DLL_IMPORT
+#endif
+#if defined(FedTime_EXPORTS)
+ #define FEDTIME_EXPORT ANY_DLL_EXPORT
+#else
+ #define FEDTIME_EXPORT ANY_DLL_IMPORT
+#endif
+
+#ifdef RTI_USES_STD_FSTREAM
+#include <fstream>
+#define RTI_STD std
+#else
+#include <fstream.h>
+#define RTI_STD
+#endif
+
+class RTIambPrivateRefs ;
+struct RTIambPrivateData ;
+
+/**
+ * @defgroup libRTI RTI library (normative API).
+ * @ingroup HLA_Libraries
+ * The API comes directly from HLA specifications.
+ * @{
+ */
+
+class RTI_EXPORT RTI
+{
+public:
+#include "baseTypes.hh"
+#include "RTItypes.hh"
+
+ /**
+ * RTI (RunTime Infrastructure) Ambassador class.
+ * The RTIambassador class is the interface used by an
+ * HLA federate to call the RTI. The RTI may call the
+ * federate back using the Federate Ambassador class
+ * @see FederateAmbassador.
+ */
+ class RTI_EXPORT RTIambassador
+ {
+ public:
+#include "RTIambServices.hh"
+ RTIambPrivateData *privateData ;
+ private:
+ RTIambPrivateRefs* privateRefs ;
+ };
+
+ /**
+ * Federate Ambassador class.
+ * The FederateAmbassador is the structure RTI callback class.
+ * When the RTI needs to contact the federate it calls one
+ * of the FederateAmbassador class methods.
+ */
+ class RTI_EXPORT FederateAmbassador
+ {
+ public:
+#include "federateAmbServices.hh"
+ };
+};
+
+RTI_STD::ostream RTI_EXPORT &
+operator<<(RTI_STD::ostream &os, RTI::Exception *ex);
+
+RTI_STD::ostream RTI_EXPORT &
+operator<<(RTI_STD::ostream &os, RTI::Exception const &ex);
+
+/** @} */
+
+#endif
Index: include/federateAmbServices.hh
===================================================================
RCS file: include/federateAmbServices.hh
diff -N include/federateAmbServices.hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ include/federateAmbServices.hh 24 Sep 2013 14:46:22 -0000 3.3
@@ -0,0 +1,150 @@
+// HLA 1.3 Header "federateAmbServices.hh"
+
+// Federation Management
+
+virtual void synchronizationPointRegistrationSucceeded(const char *)
+ throw (FederateInternalError) = 0 ;
+
+virtual void synchronizationPointRegistrationFailed(const char *)
+ throw (FederateInternalError) = 0 ;
+
+virtual void announceSynchronizationPoint(const char *, const char *)
+ throw (FederateInternalError) = 0 ;
+
+virtual void federationSynchronized(const char *)
+ throw (FederateInternalError) = 0 ;
+
+virtual void initiateFederateSave (const char *)
+ throw (UnableToPerformSave, FederateInternalError) = 0 ;
+
+virtual void federationSaved()
+ throw (FederateInternalError) = 0 ;
+
+virtual void federationNotSaved ()
+ throw (FederateInternalError) = 0 ;
+
+virtual void requestFederationRestoreSucceeded (const char *)
+ throw (FederateInternalError) = 0 ;
+
+virtual void requestFederationRestoreFailed(const char *, const char *)
+ throw (FederateInternalError) = 0 ;
+
+virtual void federationRestoreBegun()
+ throw (FederateInternalError) = 0 ;
+
+virtual void initiateFederateRestore (const char *, FederateHandle)
+ throw (SpecifiedSaveLabelDoesNotExist, CouldNotRestore,
FederateInternalError) = 0 ;
+
+virtual void federationRestored()
+ throw (FederateInternalError) = 0 ;
+
+virtual void federationNotRestored()
+ throw (FederateInternalError) = 0 ;
+
+// Declaration Management
+
+virtual void startRegistrationForObjectClass(ObjectClassHandle)
+ throw (ObjectClassNotPublished, FederateInternalError) = 0 ;
+
+virtual void stopRegistrationForObjectClass(ObjectClassHandle)
+ throw (ObjectClassNotPublished, FederateInternalError) = 0 ;
+
+virtual void turnInteractionsOn(InteractionClassHandle)
+ throw (InteractionClassNotPublished, FederateInternalError) = 0 ;
+
+virtual void turnInteractionsOff(InteractionClassHandle)
+ throw (InteractionClassNotPublished, FederateInternalError) = 0 ;
+
+// Object Management
+
+virtual void discoverObjectInstance(ObjectHandle, ObjectClassHandle, const
char *)
+ throw (CouldNotDiscover, ObjectClassNotKnown, FederateInternalError) = 0 ;
+
+virtual void reflectAttributeValues(ObjectHandle, const
AttributeHandleValuePairSet &,
+ const FedTime &, const char *,
EventRetractionHandle)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateOwnsAttributes,
InvalidFederationTime,
+ FederateInternalError) = 0 ;
+
+virtual void reflectAttributeValues(ObjectHandle, const
AttributeHandleValuePairSet &, const char *)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateOwnsAttributes,
FederateInternalError) = 0 ;
+
+virtual void receiveInteraction(InteractionClassHandle, const
ParameterHandleValuePairSet &,
+ const FedTime &, const char *,
EventRetractionHandle)
+ throw (InteractionClassNotKnown, InteractionParameterNotKnown,
InvalidFederationTime,
+ FederateInternalError) = 0 ;
+
+virtual void receiveInteraction(InteractionClassHandle, const
ParameterHandleValuePairSet &, const char *)
+ throw (InteractionClassNotKnown, InteractionParameterNotKnown,
FederateInternalError) = 0 ;
+
+virtual void removeObjectInstance(ObjectHandle, const FedTime &, const char *,
EventRetractionHandle)
+ throw (ObjectNotKnown, InvalidFederationTime, FederateInternalError) = 0 ;
+
+virtual void removeObjectInstance(ObjectHandle, const char *)
+ throw (ObjectNotKnown, FederateInternalError) = 0 ;
+
+virtual void attributesInScope (ObjectHandle, const AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateInternalError) = 0 ;
+
+virtual void attributesOutOfScope(ObjectHandle, const AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateInternalError) = 0 ;
+
+virtual void provideAttributeValueUpdate(ObjectHandle, const
AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown, AttributeNotOwned,
FederateInternalError) = 0 ;
+
+virtual void turnUpdatesOnForObjectInstance (ObjectHandle, const
AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotOwned, FederateInternalError) = 0 ;
+
+virtual void turnUpdatesOffForObjectInstance (ObjectHandle, const
AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotOwned, FederateInternalError) = 0 ;
+
+// Ownership Management
+
+virtual void requestAttributeOwnershipAssumption(ObjectHandle, const
AttributeHandleSet &, const char *)
+ throw (ObjectNotKnown, AttributeNotKnown, AttributeAlreadyOwned,
AttributeNotPublished,
+ FederateInternalError) = 0 ;
+
+virtual void attributeOwnershipDivestitureNotification(ObjectHandle, const
AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown, AttributeNotOwned,
AttributeDivestitureWasNotRequested,
+ FederateInternalError) = 0 ;
+
+virtual void attributeOwnershipAcquisitionNotification(ObjectHandle, const
AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown,
AttributeAcquisitionWasNotRequested, AttributeAlreadyOwned,
+ AttributeNotPublished, FederateInternalError) = 0 ;
+
+virtual void attributeOwnershipUnavailable(ObjectHandle, const
AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown, AttributeNotDefined,
AttributeAlreadyOwned,
+ AttributeAcquisitionWasNotRequested, FederateInternalError) = 0 ;
+
+virtual void requestAttributeOwnershipRelease(ObjectHandle, const
AttributeHandleSet &, const char *)
+ throw (ObjectNotKnown, AttributeNotKnown, AttributeNotOwned,
FederateInternalError) = 0 ;
+
+virtual void confirmAttributeOwnershipAcquisitionCancellation(ObjectHandle,
const AttributeHandleSet &)
+ throw (ObjectNotKnown, AttributeNotKnown, AttributeNotDefined,
AttributeAlreadyOwned,
+ AttributeAcquisitionWasNotCanceled, FederateInternalError) = 0 ;
+
+virtual void informAttributeOwnership(ObjectHandle, AttributeHandle,
FederateHandle)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateInternalError) = 0 ;
+
+virtual void attributeIsNotOwned(ObjectHandle, AttributeHandle)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateInternalError) = 0 ;
+
+virtual void attributeOwnedByRTI (ObjectHandle, AttributeHandle)
+ throw (ObjectNotKnown, AttributeNotKnown, FederateInternalError) = 0 ;
+
+// Time Management
+
+virtual void timeRegulationEnabled(const FedTime &)
+ throw (InvalidFederationTime, EnableTimeRegulationWasNotPending,
FederateInternalError) = 0 ;
+
+virtual void timeConstrainedEnabled(const FedTime &)
+ throw (InvalidFederationTime, EnableTimeConstrainedWasNotPending,
FederateInternalError) = 0 ;
+
+virtual void timeAdvanceGrant(const FedTime &)
+ throw (InvalidFederationTime, TimeAdvanceWasNotInProgress,
FederationTimeAlreadyPassed,
+ FederateInternalError) = 0 ;
+
+virtual void requestRetraction(EventRetractionHandle)
+ throw (EventNotKnown, FederateInternalError) = 0 ;
+
+virtual ~FederateAmbassador()
+ throw (FederateInternalError) { ; }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi libCERTI/BaseRegion.hh libCERTI/Message.c...,
CERTI CVS commits <=