MAK Data Logger API Documentation for DIS
 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 
24  class DT_DLL_CSEC DtServerFederateAmbassadorBase
25  {
26  protected:
28  DtServerFederateAmbassadorBase( const DtServerFederateAmbassadorBase& src );
30  DtServerFederateAmbassadorBase& operator=( const DtServerFederateAmbassadorBase& src );
31 
32  public:
34  DtServerFederateAmbassadorBase();
35 
37  virtual ~DtServerFederateAmbassadorBase()
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 
128  DtServerExerciseConnection* myServerConnection;
129 
131  DtTaCallbackVector myFedAmbCallbackQueue;
132 
134  DtTaCallbackQueueVector myClientSelfReflectQueues;
135 
140  DtTaCallbackQueueVector myServerSelfReflectQueues;
141 
143  unsigned int myNumberPendingCallbacks;
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 
162  int myNewestIndex;
163 
166  unsigned int myOldestIndex;
167 
168  protected:
169 
171  static unsigned int theQueueSize;
172 
173  };
174 }
175 
176 #endif
The DtTaCallback is a base class to store callback parameters.
#define DT_DLL_CSEC
Definition: clientServerExConnDllDefines.h:17

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)