MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simpleTimeFedAmb13.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: simpleTimeFedAmb13.h,v $ $Revision: 1.2 $ $State: Exp $
7 *******************************************************************************/
8 
9 #pragma once
10 #pragma warning(disable: 4786)
11 #pragma warning(disable: 4290)
12 
13 #include "NullFederateAmbassador.hh"
14 #include <map>
15 #include <set>
16 #include <string>
18 
19 
20 // Map between strings and attribute handles
21 typedef std::map<std::string, RTI::AttributeHandle> DtAttrNameHandleMap;
22 typedef std::map<std::string, RTI::ParameterHandle> DtParamNameHandleMap;
23 
24 class DtTalkAmbData
25 {
26 
27  public :
28  DtTalkAmbData();
30 
31 
32  public:
33  std::map<RTI::ObjectClassHandle, std::string> objectClassMap;
34  std::map<RTI::ObjectHandle, std::string> objectInstanceMap;
35  std::map<RTI::InteractionClassHandle, std::string> interactionClassMap;
36  std::map<RTI::ObjectHandle, RTI::AttributeHandleSet*> updateRequestMap;
37 
38  // Map between strings and attribute handles
40 
41  // Map between strings and attribute handles
43 
44  // The set of Attributes that this federate's published objects will contain.
45  std::set <std::string> ourAttrs;
46 
47  // The set of Parameters that this federate's published interactions will contain.
48  std::set <std::string> ourParms;
49 
50  // This federation of simple objects has a single master object, (determined by command line arguments)
51  // The master federate will keep the other federates from entering their main loop of execution until
52  // all of numFederates have joined.
53  bool isMaster;
54 
55  // numFederates is the number of federates (including the master) that the master should wait to join the
56  // federation before it allows any federate to enter its main loop.
57  // This variable is only used by the master federate.
59 
60  RTI::AttributeHandleValuePairSet* attrValues;
61  RTI::ParameterHandleValuePairSet* paramValues;
62 
66  RTI::FedTime* time;
73 };
74 
75 
76 class MyFederateAmbassador : public NullFederateAmbassador
77 {
78 public:
79 
81 
82  virtual ~MyFederateAmbassador()
83  throw (RTI::FederateInternalError);
84 
85  virtual void discoverObjectInstance (
86  RTI::ObjectHandle theObject,
87  RTI::ObjectClassHandle theObjectClass,
88  const char* theObjectName)
89  throw (
90  RTI::CouldNotDiscover,
91  RTI::ObjectClassNotKnown,
92  RTI::FederateInternalError);
93 
94  virtual void reflectAttributeValues (
95  RTI::ObjectHandle theObject,
96  const RTI::AttributeHandleValuePairSet& theAttributes,
97  const RTI::FedTime& theTime,
98  const char *theTag,
99  RTI::EventRetractionHandle theHandle)
100  throw (
101  RTI::ObjectNotKnown,
102  RTI::AttributeNotKnown,
103  RTI::FederateOwnsAttributes,
104  RTI::InvalidFederationTime,
105  RTI::FederateInternalError);
106 
107  virtual void reflectAttributeValues (
108  RTI::ObjectHandle theObject,
109  const RTI::AttributeHandleValuePairSet& theAttributes,
110  const char *theTag)
111  throw (
112  RTI::ObjectNotKnown,
113  RTI::AttributeNotKnown,
114  RTI::FederateOwnsAttributes,
115  RTI::FederateInternalError);
116 
117  // 4.6
118  virtual void receiveInteraction (
119  RTI::InteractionClassHandle theInteraction,
120  const RTI::ParameterHandleValuePairSet& theParameters,
121  const RTI::FedTime& theTime,
122  const char *theTag,
123  RTI::EventRetractionHandle theHandle)
124  throw (
125  RTI::InteractionClassNotKnown,
126  RTI::InteractionParameterNotKnown,
127  RTI::InvalidFederationTime,
128  RTI::FederateInternalError);
129 
130  virtual void receiveInteraction (
131  RTI::InteractionClassHandle theInteraction,
132  const RTI::ParameterHandleValuePairSet& theParameters,
133  const char *theTag)
134  throw (
135  RTI::InteractionClassNotKnown,
136  RTI::InteractionParameterNotKnown,
137  RTI::FederateInternalError);
138 
139  virtual void removeObjectInstance (
140  RTI::ObjectHandle theObject,
141  const RTI::FedTime& theTime,
142  const char *theTag,
143  RTI::EventRetractionHandle theHandle)
144  throw (
145  RTI::ObjectNotKnown,
146  RTI::InvalidFederationTime,
147  RTI::FederateInternalError);
148 
149  virtual void removeObjectInstance (
150  RTI::ObjectHandle theObject,
151  const char *theTag)
152  throw (
153  RTI::ObjectNotKnown,
154  RTI::FederateInternalError);
155 
156  virtual void provideAttributeValueUpdate (
157  RTI::ObjectHandle theObject,
158  const RTI::AttributeHandleSet& theAttributes)
159  throw (
160  RTI::ObjectNotKnown,
161  RTI::AttributeNotKnown,
162  RTI::AttributeNotOwned,
163  RTI::FederateInternalError);
164 
165  virtual void timeRegulationEnabled (
166  const RTI::FedTime& theFederateTime)
167  throw (
168  RTI::InvalidFederationTime,
169  RTI::EnableTimeRegulationWasNotPending,
170  RTI::FederateInternalError);
171 
172  virtual void timeConstrainedEnabled (
173  const RTI::FedTime& theFederateTime)
174  throw (
175  RTI::InvalidFederationTime,
176  RTI::EnableTimeConstrainedWasNotPending,
177  RTI::FederateInternalError);
178 
179  virtual void timeAdvanceGrant (
180  const RTI::FedTime& theTime)
181  throw (
182  RTI::InvalidFederationTime,
183  RTI::TimeAdvanceWasNotInProgress,
184  RTI::FederateInternalError);
185 
187  const char *label)
188  throw (
189  RTI::FederateInternalError);
190 
191 
193  const char *label)
194  throw (
195  RTI::FederateInternalError);
196 
197  virtual void announceSynchronizationPoint (
198  const char *label,
199  const char *tag)
200  throw (
201  RTI::FederateInternalError);
202 
203  virtual void federationSynchronized (
204  const char *label)
205  throw (
206  RTI::FederateInternalError);
207 
208 public:
210 };
211 
std::map< std::string, RTI::AttributeHandle > DtAttrNameHandleMap
Definition: simpleDDMSimple13.h:25
std::set< std::string > ourAttrs
Definition: simpleTimeFedAmb13.h:45
std::map< ObjectClassHandle, std::string > objectClassMap
Definition: rtiSimpleFedAmb13dlc.h:33
Basic federate ambassador service callback implementation.
Definition: rtiSimpleFedAmb13.h:35
std::set< AttributeHandle > AttributeHandleSet
Definition: Typedefs.h:35
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)
std::map< ObjectHandle, std::string > objectInstanceMap
Definition: rtiSimpleFedAmb13dlc.h:34
RTI::FedTime * time
Definition: simpleTimeFedAmb13.h:66
virtual void receiveInteraction(RTI::InteractionClassHandle theInteraction, const RTI::ParameterHandleValuePairSet &theParameters, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
bool registerSucceeded
Definition: simpleTimeFedAmb13.h:69
virtual void synchronizationPointRegistrationSucceeded(const char *label)
std::map< InteractionClassHandle, std::string > interactionClassMap
Definition: rtiSimpleFedAmb13dlc.h:35
virtual void synchronizationPointRegistrationFailed(const char *label)
virtual void removeObjectInstance(RTI::ObjectHandle theObject, const RTI::FedTime &theTime, const char *theTag, RTI::EventRetractionHandle theHandle)
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)
bool isConstrained
Definition: simpleTimeFedAmb13.h:63
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)
timeManagedEntity timeManagedObject
Definition: simpleTimeFedAmb13.h:72
bool isMaster
Definition: simpleTimeFedAmb13.h:53
bool announceSyncReceived
Definition: simpleTimeFedAmb13.h:70
int numFederates
Definition: simpleTimeFedAmb13.h:58
Definition: rtiSimpleFedAmb13dlc.h:15
std::map< RTI::ObjectHandle, RTI::AttributeHandleSet * > updateRequestMap
Definition: simpleTimeFedAmb13.h:36
int otherFederatesReady
Definition: simpleTimeFedAmb13.h:67
RTI::ParameterHandleValuePairSet * paramValues
Definition: simpleTimeFedAmb13.h:61
bool registerFailed
Definition: simpleTimeFedAmb13.h:68
virtual ~MyFederateAmbassador()
std::map< std::string, RTI::ParameterHandle > DtParamNameHandleMap
Definition: simpleDDMSimple13.h:27
RTI::AttributeHandleValuePairSet * attrValues
Definition: simpleTimeFedAmb13.h:60
virtual void timeConstrainedEnabled(const RTI::FedTime &theFederateTime)
MyFederateAmbassador(DtSimpleData &data)
virtual void announceSynchronizationPoint(const char *label, const char *tag)
bool federationIsSynchronized
Definition: simpleTimeFedAmb13.h:71
virtual void federationSynchronized(const char *label)
std::set< std::string > ourParms
Definition: simpleTimeFedAmb13.h:48
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)