MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleTimeFedAmb1516_2025.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: simpleTimeFedAmb1516.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef MyFederateAmbassador_H_
10 #define MyFederateAmbassador_H_
11 
12 #ifdef WIN32
13 #pragma warning(disable: 4251)
14 #pragma warning(disable: 4786)
15 #pragma warning(disable: 4290)
16 #endif
17 
18 #include <RTI/Enums.h>
19 #include <RTI/Typedefs.h>
20 #include <RTI/RTI1516.h>
22 #include "simpleTimeStringUtil.h"
24 #include <string>
25 #include <map>
26 
27 typedef std::map<std::wstring, rti1516_2025::AttributeHandle> DtAttrNameHandleMap;
28 typedef std::map<std::wstring, rti1516_2025::ParameterHandle> DtParamNameHandleMap;
29 
30 class DtTalkAmbData
31 {
32 
33  public:
34 
35  DtTalkAmbData();
37 
38 
39  public:
40 
43  std::map<rti1516_2025::ObjectClassHandle, std::wstring> objectClassMap;
44  std::map<rti1516_2025::ObjectInstanceHandle, std::wstring> objectInstanceMap;
45  std::map<rti1516_2025::InteractionClassHandle,std::wstring> interactionClassMap;
46  std::map<rti1516_2025::ObjectInstanceHandle, rti1516_2025::AttributeHandleSet*> updateRequestMap;
47 
48  // Map between strings and attribute handles
50 
51  // Map between strings and paramterHandles
53 
54  // The set of Attributes that this federate's published objects will contain.
55  std::set<std::string> ourAttrs;
56 
57  // the Set of Parameters that this federate's published interactions will contain.
58  std::set<std::string> ourParms;
59 
60  // This federation of simple objects has a single master object, (determined by command line arguments)
61  // The master federate will keep the other federates from entering their main loop of execution until
62  // all of numFederates have joined.
63  bool isMaster;
64 
65  // numFederates is the number of federates (including the master) that the master should wait to join the
66  // federation before it allows any federate to enter its main loop.
67  // This variable is only used by the master federate.
68  int numFederates;
69 
72  rti1516_2025::TransportationTypeHandle bestEffortHandle;
73  bool isConstrained;
74  bool isRegulating;
75  bool timeAdvanced;
78  bool registerFailed;
79  bool registerSucceeded;
83 };
84 
86 {
87  public:
88 
90 
91  virtual ~MyFederateAmbassador ();
92 
93  // 6.3
94  virtual void objectInstanceNameReservationSucceeded(std::wstring const & theObjectInstanceName);
95 
96  virtual void objectInstanceNameReservationFailed(std::wstring const & theObjectInstanceName);
97 
98  // 6.5
99  virtual void discoverObjectInstance (
100  rti1516_2025::ObjectInstanceHandle const & theObject,
101  rti1516_2025::ObjectClassHandle const & theObjectClass,
102  std::wstring const & theObjectInstanceName);
103 
104  virtual void discoverObjectInstance (
105  rti1516_2025::ObjectInstanceHandle const & theObject,
106  rti1516_2025::ObjectClassHandle const & theObjectClass,
107  std::wstring const & theObjectInstanceName,
108  rti1516_2025::FederateHandle const & producingFederate);
109 
110  // 6.11
111  virtual void reflectAttributeValues(
112  rti1516_2025::ObjectInstanceHandle const& theObject,
113  rti1516_2025::AttributeHandleValueMap const& theAttributeValues,
114  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
115  rti1516_2025::TransportationTypeHandle const& theType,
116  rti1516_2025::FederateHandle const& theProducingFederate,
117  rti1516_2025::RegionHandleSet const* theOptionalSentRegions);
118 
119  virtual void reflectAttributeValues(
120  rti1516_2025::ObjectInstanceHandle const& theObject,
121  rti1516_2025::AttributeHandleValueMap const& theAttributeValues,
122  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
123  rti1516_2025::TransportationTypeHandle const& theType,
124  rti1516_2025::FederateHandle const& theProducingFederate,
125  rti1516_2025::RegionHandleSet const* theOptionalSentRegions,
126  rti1516_2025::LogicalTime const& theTime,
127  rti1516_2025::OrderType theSentOrder,
128  rti1516_2025::OrderType theReceivedOrder,
129  rti1516_2025::MessageRetractionHandle const* theOptionalRetraction);
130 
131  // 6.13
132  virtual void receiveInteraction(
133  rti1516_2025::InteractionClassHandle const& theInteraction,
134  rti1516_2025::ParameterHandleValueMap const& theParameterValues,
135  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
136  rti1516_2025::TransportationTypeHandle const& theType,
137  rti1516_2025::FederateHandle const& theProducingFederate,
138  const rti1516_2025::RegionHandleSet* theOptionalSentRegions);
139 
140  virtual void receiveInteraction(
141  rti1516_2025::InteractionClassHandle const& theInteraction,
142  rti1516_2025::ParameterHandleValueMap const& theParameterValues,
143  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
144  rti1516_2025::TransportationTypeHandle const& theType,
145  rti1516_2025::FederateHandle const& theProducingFederate,
146  rti1516_2025::RegionHandleSet const* theOptionalSentRegions,
147  rti1516_2025::LogicalTime const& theTime,
148  rti1516_2025::OrderType theSentOrder,
149  rti1516_2025::OrderType theReceivedOrder,
150  rti1516_2025::MessageRetractionHandle const* theOptionalRetraction);
151 
152 #if 0
153  // HLA4_TODO
154  // 6.13
155  virtual void receiveDirectedInteraction(
156  rti1516_2025::InteractionClassHandle const& theInteraction,
157  rti1516_2025::ObjectInstanceHandle const& theObject,
158  rti1516_2025::ParameterHandleValueMap const& theParameterValues,
159  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
160  rti1516_2025::TransportationTypeHandle const& theType,
161  rti1516_2025::FederateHandle const& producingFederate);
162 
163  virtual void receiveDirectedInteraction(
164  rti1516_2025::InteractionClassHandle const& theInteraction,
165  rti1516_2025::ObjectInstanceHandle const& theObject,
166  rti1516_2025::ParameterHandleValueMap const& theParameterValues,
167  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
168  rti1516_2025::TransportationTypeHandle const& theType,
169  rti1516_2025::FederateHandle const& theProducingFederate,
170  rti1516_2025::LogicalTime const& theTime,
171  rti1516_2025::OrderType theSentOrder,
172  rti1516_2025::OrderType theReceivedOrder,
173  rti1516_2025::MessageRetractionHandle const* theOptionalRetraction);
174 #endif
175 
176  // 6.15
177  virtual void removeObjectInstance(
178  rti1516_2025::ObjectInstanceHandle const& theObject,
179  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
180  rti1516_2025::FederateHandle const& theProducingFederate);
181 
182  virtual void removeObjectInstance(
183  rti1516_2025::ObjectInstanceHandle const& theObject,
184  rti1516_2025::VariableLengthData const& theUserSuppliedTag,
185  rti1516_2025::FederateHandle const& theProducingFederate,
186  rti1516_2025::LogicalTime const& theTime,
187  rti1516_2025::OrderType theSentOrder,
188  rti1516_2025::OrderType theReceivedOrder,
189  rti1516_2025::MessageRetractionHandle const* theOptionalRetraction);
190 
191  virtual void provideAttributeValueUpdate(rti1516_2025::ObjectInstanceHandle const & theObject,
192  rti1516_2025::AttributeHandleSet const & theAttributes,
193  rti1516_2025::VariableLengthData const & theUserSuppliedTag);
194 
195  virtual void timeRegulationEnabled(rti1516_2025::LogicalTime const & theFederateTime);
196 
197  virtual void timeConstrainedEnabled(rti1516_2025::LogicalTime const & theFederateTime);
198 
199  virtual void timeAdvanceGrant(rti1516_2025::LogicalTime const & theTime);
200 
201  virtual void requestRetraction(rti1516_2025::MessageRetractionHandle const & theHandle);
202 
203  virtual void synchronizationPointRegistrationSucceeded(std::wstring const & label );
204  virtual void synchronizationPointRegistrationFailed(std::wstring const & label,
206 
207  virtual void announceSynchronizationPoint(std::wstring const & label,
208  rti1516_2025::VariableLengthData const & theUserSuppliedTag);
209 
210  virtual void federationSynchronized(std::wstring const & label, rti1516_2025::FederateHandleSet const& failedToSyncSet);
211 
212  protected:
213 
215 
216  public:
218 };
219 
220 #endif
221 
222 
Definition: LogicalTime.h:30
std::set< AttributeHandle > AttributeHandleSet
Definition: Typedefs.h:29
virtual void objectInstanceNameReservationFailed(std::wstring const &theObjectInstanceName)
A convenience header provided for developers that would like to include everything all at once...
rti1516_2025::AttributeHandleValueMap * attrValues
Definition: simpleTimeFedAmb1516_2025.h:70
std::map< std::string, RTI::AttributeHandle > DtAttrNameHandleMap
Definition: simpleDDMSimple13.h:25
std::set< std::string > ourAttrs
Definition: simpleTimeFedAmb13.h:45
Basic federate ambassador service callback implementation.
Definition: rtiSimpleFedAmb13.h:35
OrderType
Definition: Enums.h:28
bool isRegulating
Definition: simpleTimeFedAmb13.h:64
DtParamNameHandleMap theParamNameHandleMap
Definition: simpleTimeFedAmb13.h:42
DtAttrNameHandleMap theAttrNameHandleMap
Definition: simpleTimeFedAmb13.h:39
virtual void provideAttributeValueUpdate(RTI::ObjectHandle theObject, const RTI::AttributeHandleSet &theAttributes)
virtual void receiveInteraction(RTI::InteractionClassHandle theInteraction, const RTI::ParameterHandleValuePairSet &theParameters, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void objectInstanceNameReservationSucceeded(std::wstring const &theObjectInstanceName)
bool registerSucceeded
Definition: simpleTimeFedAmb13.h:69
SynchronizationPointFailureReason
Definition: Enums.h:92
virtual void synchronizationPointRegistrationSucceeded(const char *label)
virtual void synchronizationPointRegistrationFailed(const char *label)
virtual void removeObjectInstance(RTI::ObjectHandle theObject, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void receiveDirectedInteraction(rti1516_2025::InteractionClassHandle const &theInteraction, rti1516_2025::ObjectInstanceHandle const &theObject, rti1516_2025::ParameterHandleValueMap const &theParameterValues, rti1516_2025::VariableLengthData const &theUserSuppliedTag, rti1516_2025::TransportationTypeHandle const &theType, rti1516_2025::FederateHandle const &producingFederate) override
bool timeAdvanced
Definition: simpleTimeFedAmb13.h:65
Definition: simpleTimeTimeManagedEntity.h:32
virtual void reflectAttributeValues(RTI::ObjectHandle theObject, const RTI::AttributeHandleValuePairSet &theAttributes, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
virtual void requestRetraction(rti1516_2025::MessageRetractionHandle const &theHandle)
std::map< rti1516_2025::ObjectClassHandle, std::wstring > objectClassMap
Definition: simpleTimeFedAmb1516_2025.h:43
bool isConstrained
Definition: simpleTimeFedAmb13.h:63
rti1516_2025::ParameterHandleValueMap * paramValues
Definition: simpleTimeFedAmb1516_2025.h:71
DtSimpleData & myData
Definition: rtiSimpleFedAmb13.h:98
virtual void discoverObjectInstance(RTI::ObjectHandle theObject, RTI::ObjectClassHandle theObjectClass, const char *theObjectName)
virtual void timeAdvanceGrant(const RTI::FedTime &theTime)
std::map< rti1516_2025::ObjectInstanceHandle, std::wstring > objectInstanceMap
Definition: simpleTimeFedAmb1516_2025.h:44
timeManagedEntity timeManagedObject
Definition: simpleTimeFedAmb13.h:72
bool isMaster
Definition: simpleTimeFedAmb13.h:53
This file contains the standard RTI types that are defined in namespace rti1516.
std::map< rti1516_2025::ObjectInstanceHandle, rti1516_2025::AttributeHandleSet * > updateRequestMap
Definition: simpleTimeFedAmb1516_2025.h:46
rti1516_2025::LogicalTime * time
Definition: simpleTimeFedAmb1516_2025.h:76
bool announceSyncReceived
Definition: simpleTimeFedAmb13.h:70
interaction_type
Definition: simpleTimeInteraction13.h:27
int numFederates
Definition: simpleTimeFedAmb13.h:58
virtual interactionEvent::interaction_type interactionTypeFromParameterValues(rti1516_2025::ParameterHandleValueMap const &theParameterValues) const
Definition: rtiSimpleFedAmb13dlc.h:15
std::map< AttributeHandle, VariableLengthData > AttributeHandleValueMap
Definition: Typedefs.h:39
Definition: NullFederateAmbassador.h:20
int otherFederatesReady
Definition: simpleTimeFedAmb13.h:67
This file contains enumerations used by the interface.
bool registerFailed
Definition: simpleTimeFedAmb13.h:68
virtual ~MyFederateAmbassador()
bool myNameReservationSucceeded
Definition: simpleDDMFedAmb1516.h:28
std::map< std::string, RTI::ParameterHandle > DtParamNameHandleMap
Definition: simpleDDMSimple13.h:27
virtual void timeConstrainedEnabled(const RTI::FedTime &theFederateTime)
This file provides an example derivation of the rti1516_2025::FederateAmbassador with NULL actions fo...
std::map< rti1516_2025::InteractionClassHandle, std::wstring > interactionClassMap
Definition: simpleTimeFedAmb1516_2025.h:45
MyFederateAmbassador(DtSimpleData &data)
Definition: VariableLengthData.h:28
virtual void announceSynchronizationPoint(const char *label, const char *tag)
bool myNameReservationReturned
Definition: simpleDDMFedAmb1516.h:27
rti1516_2025::TransportationTypeHandle bestEffortHandle
Definition: simpleTimeFedAmb1516_2025.h:72
bool federationIsSynchronized
Definition: simpleTimeFedAmb13.h:71
virtual void federationSynchronized(const char *label)
std::set< std::string > ourParms
Definition: simpleTimeFedAmb13.h:48
std::map< ParameterHandle, VariableLengthData > ParameterHandleValueMap
Definition: Typedefs.h:44
std::set< FederateHandle > FederateHandleSet
Definition: Typedefs.h:32
std::set< RegionHandle > RegionHandleSet
Definition: Typedefs.h:34
virtual void timeRegulationEnabled(const RTI::FedTime &theFederateTime)

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)