VR-Vantage
Loading...
Searching...
No Matches
DtAgent.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
12#include <vrvCore/vrvCore.h>
16
17#include <vlutil/vlThread.h>
18
19#include <boost/type_traits.hpp>
20#include <map>
21#include <string>
22#include <list>
23
24namespace makVrv
25{
26 template <typename T,bool>
28
29 template <typename T>
30 struct ArgOverrideAsId<T,false>
31 {
32 typedef T Type;
33 };
34
35 template <typename T>
36 struct ArgOverrideAsId<T,true>
37 {
39 };
40
43 template <typename T>
44 struct Arg
45 {
47 boost::is_class<typename boost::remove_pointer<T>::type >::value>::Type Type;
48 };
49
50
51
55 {
56 public:
57
60 friend class DtAgentManager;
61
63 virtual ~DtAgent();
64
68
70 inline void setSceneInterface(DtAgentManagerInterface* iface);
71
75
77 inline const std::string& className() const;
78
79 //Makes the object clean, it will not generate an update.
80 inline void clean();
81
82 //Makes the object dirty, indicating that it will be checked for an update
83 inline void dirty();
84
86 inline DtUniqueID uniqueId() const;
87
90 inline bool distributeMessages() const;
91
92 protected:
93
95 inline DtMessage& startNewCall(unsigned int function);
96
99
102
104 inline unsigned int callCount() const;
105
106 //This declares a template function for queuing a single operation call with N arguments
109 #define DT_DECLARE_QUEUE_OPERATION_FUNCTION(argCount)\
110 template <typename C, MAKE_LIST(typename T,argCount) >\
111 inline void queueOperationCall(unsigned int state_function,\
112 void (C::*m)( MAKE_LIST(T,argCount) ),\
113 MAKE_MULTILIST(typename Arg<T,>::Type t,argCount));
114
115 //No arguments are a special case
116 template <typename C>
117 inline void queueOperationCall(unsigned int state_function, void (C::*m)());
118
131 protected:
132
134 DtAgent(/* Do not add parameters here. Add them to init(). */);
135
138
140 inline DtAgentManagerInterface::OrderedCallList& callList();
141
142 protected:
143
146 std::string myClassName;
150 DtThreadId myThreadId;
151 };
152
153}
154
155#define DtAgent_INL_
156#include "DtAgent.inl"
157#undef DtAgent_INL_
#define DT_DECLARE_QUEUE_OPERATION_FUNCTION(argCount)
Definition DtAgent.h:109
Interaction makVrv::DtAgent class.
Contains makVrv:DtAgentManager class.
Contains makVrv::DtAgentManagerInterface class.
void setSceneInterface(DtAgentManagerInterface *iface)
Set the internal scene interface pointer.
Definition DtAgent.inl:23
void dirty()
Definition DtAgent.inl:45
bool distributeMessages() const
Accessor for myDistributeMessageFlag. Returns true if messages are going to be distributed to each sl...
Definition DtAgent.inl:88
virtual ~DtAgent()
DTOR.
void addCreateObjectCall()
Add a call which will create the actual object.
const std::string & className() const
Get the class name.
Definition DtAgent.inl:29
std::string myClassName
Definition DtAgent.h:146
DtMessage & startNewCall(unsigned int function)
Inline get arguments for a operation call operation.
Definition DtAgent.inl:62
DtUniqueID myUniqueId
Definition DtAgent.h:145
DtAgentManagerInterface::OrderedCallList & callList()
Get a pointer to the call list.
Definition DtAgent.inl:82
DtAgentManagerInterface * mySceneInterface
Definition DtAgent.h:144
unsigned int callCount() const
Get the number of calls.
Definition DtAgent.inl:76
DtAgentManagerInterface::OrderedCallList myCalls
Definition DtAgent.h:148
bool myDistributeObjectFlag
Definition DtAgent.h:149
void clean()
Definition DtAgent.inl:35
DtUniqueID uniqueId() const
inline accessor
Definition DtAgent.inl:55
friend class DtAgentManagerInterface
Allow the scene manager interface access the processed functions.
Definition DtAgent.h:59
DtAgentManagerInterface & sceneInterface()
Definition DtAgent.inl:18
friend class DtAgentManager
Definition DtAgent.h:60
void addDeleteObjectCall()
Add a call to delete an object.
void init(DtAgentManagerInterface &sceneInterface, bool bDistribute)
bool myUpdateFlag
Definition DtAgent.h:147
DtThreadId myThreadId
Definition DtAgent.h:150
The IGI Message. Is easily encoded and decoding using stream operators. It also provides validation d...
Definition DtMessage.h:31
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
unsigned long long DtUniqueID
Definition DtUniqueID.h:19
Definition DtAgent.h:45
ArgOverrideAsId< T, boost::is_pointer< T >::value &&boost::is_class< typenameboost::remove_pointer< T >::type >::value >::Type Type
Definition DtAgent.h:47
T Type
Definition DtAgent.h:32
DtUniqueID Type
Definition DtAgent.h:38
Definition DtAgent.h:27
Contains utility macros and methods for templates.
Contains DLL export macros.
#define DT_DLL_VRVCORE
Definition vrvCore.h:20