WebLVC 1.8 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
exerciseConn.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2014 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #if DtTENA
11 
12 #pragma once
13 
14 // If <WinSock.h> or <WinSock2.h> is included before <TENA/Middleware/config.h>;
15 // a compile warning "warning C4005: 'FD_SETSIZE' : macro redefinition" will be
16 // issued. To prevent this, undefine FD_SETSIZE before including
17 // <vlTena/exerciseConn.h> which includes <TENA/Middleware/config.h>
18 // Root cause: <TENA/Middleware/config.h> eventually includes one of the
19 // dct-config-msvc-?.?.h headers; all of which fail to detect if FD_SETSIZE
20 // was previously defined as requred.
21 #if !defined DCT_ace_generic_config_h && defined FD_SETSIZE
22 #undef FD_SETSIZE
23 #endif
24 
25 #include <vlTena/dllExport.h>
26 
27 #include <TENA/Middleware/config.h>
28 #include <TENA/Middleware/SDO/ID.h>
29 
31 
32 #include <vl/globalObjectDesignator.h>
33 #include <vl/baseExerciseConn.h>
34 #include <vl/eventId.h>
35 
36 #include <set>
37 
38 class DtDynamicLibrary;
39 
40 namespace MAKVrExchange
41 {
42 
43  namespace DtTenaBroker
44  {
45 
46  class DtLromMapper;
47  class DtInteraction;
48  class DtAmoPublisher;
49  class DtExerciseConnInitializer;
50 
56  class DT_DLL_VLTENA DtExerciseConn : public DtBaseExerciseConn
57  {
58  public:
59 
61  typedef DtLromMapper* (*DtLromMapperCreator)(void* usr);
62 
64  typedef void (*DtLromMapperDeletor)(DtLromMapper*);
65 
66  public:
67 
71  DtExerciseConn(const DtExerciseConnInitializer& init);
72 
76  DtExerciseConn(int site, int app, DtLromMapper* mapper, const DtString& execName,
77  const DtString& sessionName, const DtString& orbDefaultInitRef, bool useAmo = true,
78  TENA::Middleware::CommunicationProperties transport = TENA::Middleware::Reliable);
79 
81  virtual ~DtExerciseConn();
82 
84  virtual TENA::Middleware::SessionPtr sessionPtr();
85 
88  virtual void send( const DtStateMsg& msg );
92  virtual void sendStamped( const DtStateMsg& msg );
93 
96  virtual void send( const ::DtInteraction& msg );
100  virtual void sendStamped( const ::DtInteraction& msg );
101 
103  virtual void send( const DtInteraction& msg );
106  virtual void sendStamped( const DtInteraction& msg );
107 
109  static DtString vrlinkVersion();
110 
112  virtual int siteId() const;
113 
115  virtual int applicationId() const;
116 
122  virtual void drainInput(int usecs = 20);
123 
125  virtual void addInteractionCallback(const DtString& name,
126  DtReceiveInteractionCb cb, void* userData);
127 
129  virtual void removeInteractionCallback(const DtString& name,
130  DtReceiveInteractionCb cb, void* userData);
131 
133  virtual void applyInteractionCallback(const DtString& name,
134  DtInteraction* interaction);
135 
137  virtual DtLromMapper *lromMapper();
138 
141  virtual const DtGlobalObjectDesignator& nextMessageId();
142 
144  virtual const DtEventId& nextEventId();
145 
148  virtual void setReflecting();
149 
151  virtual bool reflecting() const;
152 
155  virtual DtAmoPublisher* amoPublisher();
156 
160  virtual void setTransportType(TENA::Middleware::CommunicationProperties transportType);
161 
163  virtual TENA::Middleware::CommunicationProperties transportType() const;
164 
168  virtual void incrementNumberOfObjectsServed();
169 
173  virtual void decrementNumberOfObjectsServed();
174 
178  virtual void incrementNumberOfProxies();
179 
183  virtual void decrementNumberOfProxies();
184 
185  protected:
186 
190  void initializeLromMapper(const DtString& lromMapperLibName, void* initData);
191 
192  void getFuncsFromSharedLib(DtDynamicLibrary& dso, DtLromMapperCreator* creator,
193  DtLromMapperDeletor* deletor);
194 
195  private:
196 
198  DtExerciseConn(const DtExerciseConn& other);
199 
201  DtExerciseConn& operator=(const DtExerciseConn& other);
202 
203  protected:
204 
205  TENA::Middleware::RuntimePtr myRuntimePtr;
206  TENA::Middleware::ExecutionPtr myExecutionPtr;
207  TENA::Middleware::SessionPtr mySessionPtr;
208  TENA::Middleware::CommunicationProperties myTransportType;
209 
210  int mySiteId;
211  int myApplicationId;
212  int myAvailEventNum;
213  DtGlobalObjectDesignator myCurrentMessageId;
214  DtEventId myCurrentEventId;
215  DtString myExecutionName;
216  DtString mySessionName;
217  DtInteractionCallbackManager myInteractionCallbackManager;
218  DtLromMapper *myLromMapper;
219  DtLromMapperCreator myDsoCreator;
220  DtLromMapperDeletor myDsoDeletor;
221  bool myUseLromMapperDeletor;
222  bool myReflecting;
223  DtAmoPublisher* myAmoPublisher;
224  DtTime myLastAmoUpdate;
225 
226  DtDynamicLibrary* myLromMapperDso;
227 
228  };
229 
230  }
231 }
232 
233 #endif // DtTENA
Contains the DtInteractionCallbackManager class declaration.
#define DT_DLL_VLTENA
Definition: brokers/tenaBroker/vlTena/dllExport.h:26

Document ID: Generated on Wed Mar 12 15:05:17 EDT 2025 from SVN revision 274272
Copyright © 2005-2025 MAK Technologies. All Rights Reserved (www.mak.com)