MAK Data Logger API Documentation for HLA
serverFederateAmbassadorBase.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 1992-2012 VT MAK
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

Document ID: Generated on Sun Dec 15 18:04:30 EST 2013 from SVN revision 134418
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)