VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
debugDrawRenderer.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
9 
10 #pragma once
11 
16 #include <map>
17 #include <string>
18 #include <list>
20 
21 class DtThread;
22 class DtInetSocket;
23 class DtInetTcpSocket;
24 class DtInetSocketMgr;
25 
26 namespace makVrv
27 {
28  class DtDe;
29 }
30 
31 namespace makVrf
32 {
33  class DtDebugDrawRendererDriver;
34 
37  {
38  public:
39  //CTOR/DTOR
40  DtDebugDrawRenderer(DtDebugDrawRendererDriver& driver, int port = DtDisplayPort, bool allowMultiple=false);
41  virtual ~DtDebugDrawRenderer();
42 
44  virtual void initializeServer();
45  virtual void shutdownServer();
46 
49  virtual void setPort(int port);
50 
52  virtual int port() const;
53 
57  virtual void sendMessage(DtBaseMessage& request);
58 
60  virtual DtBaseMessage* nextMessage();
61 
62  static double defaultHeartbeatTimeout();
63  static void setDefaultHeatbeatTimeout(double val);
64 
65  protected:
67  virtual bool handleSocketAddition(DtInetSocket* socket);
68  virtual bool handleSocketRemoval(DtInetSocket* socket);
69 
72  static bool socketAdditionCallback(DtInetSocket* sock, void* usr);
73  static bool socketRemovalCallback(DtInetSocket* sock, void* usr);
74 
76 
79  DtInetSocketMgr* mySocketManager;
80  int myPort;
81 
83 
85  static void workerFunction(void* usr, volatile bool* stop);
86  DtThread* myWorkerThread;
88 
90 
91  typedef std::map<std::string, DtInetTcpSocket*> ClientRequestMap;
93 
94  typedef std::list<DtInetTcpSocket*> ClientSocketList;
96  };
97 
100  {
101  public:
104  static DtDebugDrawRendererCreator& instance(makVrv::DtDe& de);
105 
107  static void registerInstance(makVrv::DtDe& de, DtDebugDrawRendererCreator* instance);
108 
110  virtual DtDebugDrawRenderer* create(DtDebugDrawRendererDriver& driver,
111  int port = DtDisplayPort, bool allowMultiple=false);
112  };
113 }
bool myAllowMultipleClients
Definition: debugDrawRenderer.h:82
Creator factory for the DebugDrawRenderer.
Definition: debugDrawRenderer.h:99
Virtual base class.
Definition: DtVirtualBaseClass.h:19
DtLocklessQueue< DtBaseMessage * > myIncomingQueue
Definition: debugDrawRenderer.h:78
the DtDebugDrawRenderer is the network server for receiving and sending messages to attached clients...
Definition: debugDrawRenderer.h:36
DtBaseMessage is the base class for all messages that can be sent between the server and the client...
Definition: vrfMessage.h:25
bool myShouldQuit
Definition: debugDrawRenderer.h:87
DtInetSocketMgr * mySocketManager
Definition: debugDrawRenderer.h:79
** Copyright (c) 2019 MAK Technologies, Inc.
ClientRequestMap myClientRequestMap
Definition: debugDrawRenderer.h:92
Contains makVrv::DtVirtualBaseClass class.
** Copyright (c) 2019 MAK Technologies, Inc.
std::map< std::string, DtInetTcpSocket * > ClientRequestMap
Definition: debugDrawRenderer.h:91
DtDebugDrawRenderer is the main class that controls the processing flow of the DebugDrawRenderer.
Definition: debugDrawRendererDriver.h:33
#define DT_DLL_DEBUGDRAWRENDERER
Definition: debugDrawRendererExport.h:19
int myPort
Definition: debugDrawRenderer.h:80
std::list< DtInetTcpSocket * > ClientSocketList
Definition: debugDrawRenderer.h:94
ClientSocketList myClientSockets
Definition: debugDrawRenderer.h:95
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
const int DtDisplayPort
the default port the server application is listening on
Definition: vrfDebugDrawConnector.h:28
DtDebugDrawRendererDriver & myDriver
Definition: debugDrawRenderer.h:75
DtLocklessQueue< DtBaseMessage * > myOutgoingQueue
Definition: debugDrawRenderer.h:77
DtLocklessQueue is a thread safe queue for single reader/single writer.
Definition: locklessQueue.h:20
DtThread * myWorkerThread
Definition: debugDrawRenderer.h:86
static double theDefaultHeatbeatTimeout
Definition: debugDrawRenderer.h:89

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)