Exception.hh

Go to the documentation of this file.
00001 // -*- mode:C++ ; tab-width:4 ; c-basic-offset:4 ; indent-tabs-mode:nil -*-
00002 // ----------------------------------------------------------------------------
00003 // CERTI - HLA RunTime Infrastructure
00004 // Copyright (C) 2003  ONERA
00005 //
00006 // This file is part of CERTI-libCERTI
00007 //
00008 // CERTI-libCERTI is free software ; you can redistribute it and/or
00009 // modify it under the terms of the GNU Lesser General Public License
00010 // as published by the Free Software Foundation ; either version 2 of
00011 // the License, or (at your option) any later version.
00012 //
00013 // CERTI-libCERTI is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY ; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016 // Lesser General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU Lesser General Public
00019 // License along with this program ; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021 // USA
00022 //
00023 // $Id: Exception.hh,v 3.8 2008/12/07 20:16:13 gotthardp Exp $
00024 // ----------------------------------------------------------------------------
00025 
00026 #ifndef _CERTI_EXCEPTION_HH
00027 #define _CERTI_EXCEPTION_HH
00028 
00029 #include "certi.hh"
00030 #include <string>
00031 
00032 namespace certi {
00033 
00034 typedef enum {
00035     e_NO_EXCEPTION = 0,
00036     e_ArrayIndexOutOfBounds,
00037     e_AsynchronousDeliveryAlreadyEnabled,
00038     e_AsynchronousDeliveryAlreadyDisabled,
00039     e_AttributeAlreadyOwned,
00040     e_AttributeAlreadyBeingAcquired,
00041     e_AttributeAlreadyBeingDivested,
00042     e_AttributeAcquisitionWasNotRequested,
00043     e_AttributeDivestitureWasNotRequested,
00044     e_AttributeNotDefined,
00045     e_AttributeNotKnown,
00046     e_AttributeNotOwned,
00047     e_AttributeNotPublished,
00048     e_AttributeNotSubscribed,
00049     e_ConcurrentAccessAttempted,
00050     e_CouldNotDiscover,
00051     e_CouldNotOpenRID,
00052     e_CouldNotOpenFED,
00053     e_CouldNotRestore,
00054     e_DeletePrivilegeNotHeld,
00055     e_ErrorReadingRID,
00056     e_ErrorReadingFED,
00057     e_EventNotKnown,
00058     e_FederateAlreadyPaused,
00059     e_FederateAlreadyExecutionMember,
00060     e_FederateDoesNotExist,
00061     e_FederateInternalError,
00062     e_FederateNameAlreadyInUse,
00063     e_FederateNotExecutionMember,
00064     e_FederateNotPaused,
00065     e_FederateNotPublishing,
00066     e_FederateNotSubscribing,
00067     e_FederateOwnsAttributes,
00068     e_FederatesCurrentlyJoined,
00069     e_FederateWasNotAskedToReleaseAttribute,
00070     e_FederationAlreadyPaused,
00071     e_FederationExecutionAlreadyExists,
00072     e_FederationExecutionDoesNotExist,
00073     e_FederationNotPaused,
00074     e_FederationTimeAlreadyPassed,
00075     e_RegionNotKnown,
00076     e_IDsupplyExhausted,
00077     e_InteractionClassNotDefined,
00078     e_InteractionClassNotKnown,
00079     e_InteractionClassNotPublished,
00080     e_InteractionParameterNotDefined,
00081     e_InteractionParameterNotKnown,
00082     e_InvalidDivestitureCondition,
00083     e_InvalidExtents,
00084     e_InvalidFederationTime,
00085     e_InvalidFederationTimeDelta,
00086     e_InvalidObjectHandle,
00087     e_InvalidResignAction,
00088     e_InvalidRetractionHandle,
00089     e_InvalidRoutingSpace,
00090     e_MemoryExhausted,
00091     e_NameNotFound,
00092     e_NoPauseRequested,
00093     e_NoResumeRequested,
00094     e_ObjectClassNotDefined,
00095     e_ObjectClassNotKnown,
00096     e_ObjectClassNotPublished,
00097     e_ObjectClassNotSubscribed,
00098     e_ObjectNotKnown,
00099     e_ObjectAlreadyRegistered,
00100     e_RestoreInProgress,
00101     e_RestoreNotRequested,
00102     e_RTICannotRestore,
00103     e_RTIinternalError,
00104     e_SpaceNotDefined,
00105     e_SaveInProgress,
00106     e_SaveNotInitiated,
00107     e_SecurityError,
00108     e_SpecifiedSaveLabelDoesNotExist,
00109     e_TimeAdvanceAlreadyInProgress,
00110     e_TimeAdvanceWasNotInProgress,
00111     e_TooManyIDsRequested,
00112     e_UnableToPerformSave,
00113     e_UnimplementedService,
00114     e_UnknownLabel,
00115     e_ValueCountExceeded,
00116     e_ValueLengthExceeded,
00117     e_AttributeAcquisitionWasNotCanceled,
00118     e_DimensionNotDefined,
00119     e_EnableTimeConstrainedPending,
00120     e_EnableTimeConstrainedWasNotPending,
00121     e_EnableTimeRegulationPending,
00122     e_EnableTimeRegulationWasNotPending,
00123     e_FederateLoggingServiceCalls,
00124     e_HandleValuePairMaximumExceeded,
00125     e_InteractionClassNotSubscribed,
00126     e_InvalidHandleValuePairSetContext,
00127     e_InvalidLookahead,
00128     e_InvalidOrderingHandle,
00129     e_InvalidRegionContext,
00130     e_InvalidTransportationHandle,
00131     e_OwnershipAcquisitionPending,
00132     e_RegionInUse,
00133     e_SynchronizationPointLabelWasNotAnnounced,
00134     e_TimeConstrainedAlreadyEnabled,
00135     e_TimeConstrainedWasNotEnabled,
00136     e_TimeRegulationAlreadyEnabled,
00137     e_TimeRegulationWasNotEnabled,
00138     e_NetworkError,
00139     e_NetworkSignal
00140 } TypeException ;
00141 
00142 class CERTI_EXPORT Exception
00143 {
00144 public:
00145     const std::string _reason;
00146     const char *_name;
00147 
00148     Exception(const std::string &reason)
00149         : _reason(reason) { }
00150     virtual ~Exception() { }
00151     const std::string displayMe() const;
00152     virtual long getType() const = 0;
00153 };
00154 
00155 #define CERTI_EXCEPTION(A) \
00156     class CERTI_EXPORT A : public Exception { \
00157     public: \
00158         static long _type; \
00159         A(const std::string &reason) : Exception(reason) { _name = #A; this->displayMe();} \
00160         long getType() const { return _type; } \
00161 };
00162 
00163 // RTI Exceptions for use inside libCERTI
00164 CERTI_EXCEPTION(ArrayIndexOutOfBounds)
00165 CERTI_EXCEPTION(AsynchronousDeliveryAlreadyDisabled)
00166 CERTI_EXCEPTION(AsynchronousDeliveryAlreadyEnabled)
00167 CERTI_EXCEPTION(AttributeAcquisitionWasNotRequested)
00168 CERTI_EXCEPTION(AttributeAcquisitionWasNotCanceled)
00169 CERTI_EXCEPTION(AttributeAlreadyBeingAcquired)
00170 CERTI_EXCEPTION(AttributeAlreadyBeingDivested)
00171 CERTI_EXCEPTION(AttributeAlreadyOwned)
00172 CERTI_EXCEPTION(AttributeDivestitureWasNotRequested)
00173 CERTI_EXCEPTION(AttributeNotDefined)
00174 CERTI_EXCEPTION(AttributeNotKnown)
00175 CERTI_EXCEPTION(AttributeNotOwned)
00176 CERTI_EXCEPTION(AttributeNotPublished)
00177 CERTI_EXCEPTION(ConcurrentAccessAttempted)
00178 CERTI_EXCEPTION(CouldNotDiscover)
00179 CERTI_EXCEPTION(CouldNotOpenFED)
00180 CERTI_EXCEPTION(CouldNotRestore)
00181 CERTI_EXCEPTION(DeletePrivilegeNotHeld)
00182 CERTI_EXCEPTION(DimensionNotDefined)
00183 CERTI_EXCEPTION(EnableTimeConstrainedPending)
00184 CERTI_EXCEPTION(EnableTimeConstrainedWasNotPending)
00185 CERTI_EXCEPTION(EnableTimeRegulationPending)
00186 CERTI_EXCEPTION(EnableTimeRegulationWasNotPending)
00187 CERTI_EXCEPTION(ErrorReadingFED)
00188 CERTI_EXCEPTION(EventNotKnown)
00189 CERTI_EXCEPTION(FederateAlreadyExecutionMember)
00190 CERTI_EXCEPTION(FederateInternalError)
00191 CERTI_EXCEPTION(FederateLoggingServiceCalls)
00192 CERTI_EXCEPTION(FederateNotExecutionMember)
00193 CERTI_EXCEPTION(FederateOwnsAttributes)
00194 CERTI_EXCEPTION(FederateWasNotAskedToReleaseAttribute)
00195 CERTI_EXCEPTION(FederatesCurrentlyJoined)
00196 CERTI_EXCEPTION(FederationExecutionAlreadyExists)
00197 CERTI_EXCEPTION(FederationExecutionDoesNotExist)
00198 CERTI_EXCEPTION(FederationTimeAlreadyPassed)
00199 CERTI_EXCEPTION(HandleValuePairMaximumExceeded)
00200 CERTI_EXCEPTION(InteractionClassNotDefined)
00201 CERTI_EXCEPTION(InteractionClassNotKnown)
00202 CERTI_EXCEPTION(InteractionClassNotPublished)
00203 CERTI_EXCEPTION(InteractionClassNotSubscribed)
00204 CERTI_EXCEPTION(InteractionParameterNotDefined)
00205 CERTI_EXCEPTION(InteractionParameterNotKnown)
00206 CERTI_EXCEPTION(InvalidExtents)
00207 CERTI_EXCEPTION(InvalidFederationTime)
00208 CERTI_EXCEPTION(InvalidHandleValuePairSetContext)
00209 CERTI_EXCEPTION(InvalidLookahead)
00210 CERTI_EXCEPTION(InvalidOrderingHandle)
00211 CERTI_EXCEPTION(InvalidRegionContext)
00212 CERTI_EXCEPTION(InvalidResignAction)
00213 CERTI_EXCEPTION(InvalidRetractionHandle)
00214 CERTI_EXCEPTION(InvalidTransportationHandle)
00215 CERTI_EXCEPTION(MemoryExhausted)
00216 CERTI_EXCEPTION(NameNotFound)
00217 CERTI_EXCEPTION(ObjectClassNotDefined)
00218 CERTI_EXCEPTION(ObjectClassNotKnown)
00219 CERTI_EXCEPTION(ObjectClassNotPublished)
00220 CERTI_EXCEPTION(ObjectClassNotSubscribed)
00221 CERTI_EXCEPTION(ObjectNotKnown)
00222 CERTI_EXCEPTION(ObjectAlreadyRegistered)
00223 CERTI_EXCEPTION(OwnershipAcquisitionPending)
00224 CERTI_EXCEPTION(RegionInUse)
00225 CERTI_EXCEPTION(RegionNotKnown)
00226 CERTI_EXCEPTION(RestoreInProgress)
00227 CERTI_EXCEPTION(RestoreNotRequested)
00228 CERTI_EXCEPTION(RTIinternalError)
00229 CERTI_EXCEPTION(SpaceNotDefined)
00230 CERTI_EXCEPTION(SaveInProgress)
00231 CERTI_EXCEPTION(SaveNotInitiated)
00232 CERTI_EXCEPTION(SpecifiedSaveLabelDoesNotExist)
00233 CERTI_EXCEPTION(SynchronizationPointLabelWasNotAnnounced)
00234 CERTI_EXCEPTION(TimeAdvanceAlreadyInProgress)
00235 CERTI_EXCEPTION(TimeAdvanceWasNotInProgress)
00236 CERTI_EXCEPTION(TimeConstrainedAlreadyEnabled)
00237 CERTI_EXCEPTION(TimeConstrainedWasNotEnabled)
00238 CERTI_EXCEPTION(TimeRegulationAlreadyEnabled)
00239 CERTI_EXCEPTION(TimeRegulationWasNotEnabled)
00240 CERTI_EXCEPTION(UnableToPerformSave)
00241 CERTI_EXCEPTION(ValueCountExceeded)
00242 CERTI_EXCEPTION(ValueLengthExceeded)
00243 
00244 // Additional CERTI exceptions
00245 CERTI_EXCEPTION(FederateNotPublishing)
00246 CERTI_EXCEPTION(FederateNotSubscribing)
00247 CERTI_EXCEPTION(InvalidObjectHandle)
00248 CERTI_EXCEPTION(SecurityError)
00249 CERTI_EXCEPTION(CouldNotOpenRID)
00250 CERTI_EXCEPTION(ErrorReadingRID)
00251 CERTI_EXCEPTION(FederationAlreadyPaused)
00252 CERTI_EXCEPTION(FederationNotPaused)
00253 CERTI_EXCEPTION(AttributeNotSubscribed)
00254 CERTI_EXCEPTION(FederateAlreadyPaused)
00255 CERTI_EXCEPTION(FederateDoesNotExist)
00256 CERTI_EXCEPTION(FederateNameAlreadyInUse)
00257 CERTI_EXCEPTION(FederateNotPaused)
00258 CERTI_EXCEPTION(IDsupplyExhausted)
00259 CERTI_EXCEPTION(InvalidDivestitureCondition)
00260 CERTI_EXCEPTION(InvalidFederationTimeDelta)
00261 CERTI_EXCEPTION(InvalidRoutingSpace)
00262 CERTI_EXCEPTION(NoPauseRequested)
00263 CERTI_EXCEPTION(NoResumeRequested)
00264 CERTI_EXCEPTION(TooManyIDsRequested)
00265 CERTI_EXCEPTION(UnimplementedService)
00266 CERTI_EXCEPTION(UnknownLabel)
00267 CERTI_EXCEPTION(NetworkSignal)
00268 CERTI_EXCEPTION(NetworkError)
00269 
00270 } // namespace certi
00271 
00272 #endif // _CERTI_EXCEPTION_HH
00273 
00274 // $Id: Exception.hh,v 3.8 2008/12/07 20:16:13 gotthardp Exp $

Generated on Thu Apr 30 15:53:48 2009 for CERTIDeveloperDocumentation by doxygen 1.5.5