MAK Data Logger API Documentation for HLA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
serverFederateAmbassadorBase.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 ******************************************************************************/
5 
7 
8 #pragma once
9 
10 #if DtHLA
11 
13 #include "fedAmbCallback.h"
14 #include "fedAmbCallbackBuffer.h"
15 
16 #include <queue>
17 #include <vlutil/vlTime.h>
18 
19 namespace MAKTrafficClientServerExConn
20 {
21  class DtServerExerciseConnection;
22  class DtClientExerciseConnection;
23 
25  {
26  protected:
31 
32  public:
35 
38  throw( RTI::FederateInternalError );
39 
41  virtual void setServerConnection(DtServerExerciseConnection* serverConnection);
42 
45  virtual void setReceiveSelfReflect(unsigned long clientID, bool enableReceiveSelfReflect);
46 
48  virtual bool receiveSelfReflectEnabled(unsigned long clientID) const;
49 
57  virtual int invokeCallbacks(DtClientExerciseConnection* client,
58  double maximum=-1, double minimum=0);
59 
64  virtual bool flush(DtTime sleepTime, DtTime maxTime);
65 
67  virtual void clear();
68 
71  virtual bool transferSelfReflects(unsigned int clientID);
72 
75  virtual double transferSelfReflects();
76 
78  virtual void clearOpenSlots();
79 
81  virtual void resetConnection(unsigned int clientID);
82 
84  virtual void resetConnections();
85 
86  public:
87 
89  static void setQueueSize(unsigned int size);
90 
91  protected:
92 
94  virtual void pushCallback(DtTaCallback* callback, unsigned int clientID=0,
95  bool callIsSelfReflect=false);
96 
98  virtual void pushSelfReflect(DtTaCallback* callback, unsigned int clientID);
99 
101  virtual void addConnection(DtClientExerciseConnection* conn);
102 
104  virtual void removeConnection(DtClientExerciseConnection* conn);
105 
109  virtual bool flushCallback(int callbackIndex, DtTime sleepTime, DtTime timeToQuit);
110 
112  virtual void clearSelfReflects(unsigned int clientID);
113 
115  virtual void clearSelfReflects();
116 
117  protected:
118 
120  static void addConnection(DtClientExerciseConnection* conn, void* usr);
121 
123  static void removeConnection(DtClientExerciseConnection* conn, void* usr);
124 
125  protected:
126 
129 
132 
135 
141 
144 
146  unsigned int myNextCallbackIndex;
147 
149  std::vector<unsigned int> myConnectionCallbackIndex;
150 
152  std::set<unsigned int> myConnectionIDs;
153 
155  std::set<unsigned int> myReceiveSelfReflectIDs;
156 
158  DtClock myClock;
159 
163 
166  unsigned int myOldestIndex;
167 
168  protected:
169 
171  static unsigned int theQueueSize;
172 
173  };
174 }
175 
176 #endif
std::set< unsigned int > myConnectionIDs
Connection IDs.
Definition: serverFederateAmbassadorBase.h:152
Definition: serverExerciseConnection.h:34
std::vector< DtTaCallbackQueue > DtTaCallbackQueueVector
Definition: fedAmbCallbackBuffer.h:117
DtServerExerciseConnection * myServerConnection
The server connection.
Definition: serverFederateAmbassadorBase.h:128
Definition: serverFederateAmbassadorBase.h:24
The DtTaCallback is a base class to store callback parameters.
DtTaCallbackQueueVector myClientSelfReflectQueues
The client self reflect queues.
Definition: serverFederateAmbassadorBase.h:134
std::vector< unsigned int > myConnectionCallbackIndex
The client connection index into the callback queue.
Definition: serverFederateAmbassadorBase.h:149
The base class for storing callback parameters that are generated by processing callbacks asynchronou...
Definition: fedAmbCallback.h:21
DtTaCallbackVector myFedAmbCallbackQueue
The client callback queue.
Definition: serverFederateAmbassadorBase.h:131
std::vector< DtTaCallbackBuffer > DtTaCallbackVector
Definition: fedAmbCallbackBuffer.h:115
unsigned int myNumberPendingCallbacks
The number pending callbacks.
Definition: serverFederateAmbassadorBase.h:143
DtClock myClock
Timer for limiting # callbacks.
Definition: serverFederateAmbassadorBase.h:158
std::set< unsigned int > myReceiveSelfReflectIDs
Connection that will receive self reflects.
Definition: serverFederateAmbassadorBase.h:155
#define DT_DLL_CSEC
Definition: clientServerExConnDllDefines.h:17
DtTaCallbackQueueVector myServerSelfReflectQueues
The server&#39;s staging of the self reflect queues.
Definition: serverFederateAmbassadorBase.h:140
unsigned int myOldestIndex
Keep track of oldest callback still pending May point to non pending callback if there are none...
Definition: serverFederateAmbassadorBase.h:166
int myNewestIndex
Keep track of last write to callback queue (newest callback) May point to non pending callback if the...
Definition: serverFederateAmbassadorBase.h:162
Definition: clientExerciseConnection.h:25
unsigned int myNextCallbackIndex
The index to the next open callback slot.
Definition: serverFederateAmbassadorBase.h:146
static unsigned int theQueueSize
Size of callback queue.
Definition: serverFederateAmbassadorBase.h:171

Document ID: Generated on Thu Dec 18 15:35:09 EST 2025 from SVN revision 282494
Copyright © 2024 MAK Technologies. All Rights Reserved (www.mak.com)