VR-Vantage 2.4 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
Tutorials
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvCore
DtAgent.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvCore/vrvCore.h
>
13
#include <
vrvCore/DtAgentManagerInterface.h
>
14
#include <
vrvCore/DtAgentManager.h
>
15
#include <
vrvUtil/templateUtil.h
>
16
17
#include <boost/type_traits.hpp>
18
#include <map>
19
#include <string>
20
#include <list>
21
22
namespace
makVrv
23
{
24
template
<
typename
T,
bool
>
25
struct
ArgOverrideAsId;
26
27
template
<
typename
T>
28
struct
ArgOverrideAsId<T,false>
29
{
30
typedef
T
Type
;
31
};
32
33
template
<
typename
T>
34
struct
ArgOverrideAsId<T,true>
35
{
36
typedef
DtUniqueID
Type
;
37
};
38
41
template
<
typename
T>
42
struct
Arg
43
{
44
typedef
typename
ArgOverrideAsId<T,boost::is_pointer<T>::value
&&
45
boost::is_class<typename boost::remove_pointer<T>::type
>
::value
>
::Type
Type
;
46
};
47
48
49
52
class
DT_DLL_VRVCORE
DtAgent
53
{
54
public
:
55
57
friend
class
DtAgentManagerInterface
;
58
friend
class
DtAgentManager
;
59
61
virtual
~
DtAgent
();
62
65
inline
DtAgentManagerInterface
& sceneInterface();
66
68
inline
void
setSceneInterface(
DtAgentManagerInterface
* iface);
69
72
void
init
(
DtAgentManagerInterface
& sceneInterface,
bool
bDistribute);
73
75
inline
const
std::string
& className()
const
;
76
77
//Makes the object clean, it will not generate an update.
78
inline
void
clean();
79
80
//Makes the object dirty, indicating that it will be checked for an update
81
inline
void
dirty();
82
84
inline
DtUniqueID
uniqueId()
const
;
85
88
inline
bool
distributeMessages()
const
;
89
90
protected
:
91
93
inline
DtMessage
& startNewCall(
unsigned
int
function
);
94
96
void
addCreateObjectCall();
97
99
void
addDeleteObjectCall();
100
102
inline
unsigned
int
callCount()
const
;
103
104
//This declares a template function for queuing a single operation call with N arguments
107
#define DT_DECLARE_QUEUE_OPERATION_FUNCTION(argCount)\
108
template <typename C, MAKE_LIST(typename T,argCount) >\
109
inline void queueOperationCall(unsigned int state_function,\
110
void (C::*m)( MAKE_LIST(T,argCount) ),\
111
MAKE_MULTILIST(typename Arg<T,>::Type t,argCount));
112
113
//No arguments are a special case
114
template
<
typename
C>
115
inline
void
queueOperationCall(
unsigned
int
state_function,
void
(C::*
m
)());
116
119
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(1)
120
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(2)
121
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(3)
122
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(4)
123
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(5)
124
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(6)
125
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(7)
126
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(8)
127
DT_DECLARE_QUEUE_OPERATION_FUNCTION
(9)
128
129
protected:
130
132
DtAgent(
/* Do not add parameters here. Add them to init(). */
);
133
135
DtAgent(DtAgent&);
136
138
inline DtAgentManagerInterface::OrderedCallList& callList();
139
140
protected:
141
142
DtAgentManagerInterface
* mySceneInterface;
143
DtUniqueID
myUniqueId;
144
std::
string
myClassName;
145
bool
myUpdateFlag;
146
DtAgentManagerInterface
::OrderedCallList myCalls;
147
bool
myDistributeObjectFlag;
148
};
149
150
}
151
152
#define DtAgent_INL_
153
#include "
DtAgent.inl
"
154
#undef DtAgent_INL_
Copyright © 2005-2018 VT MAK. All Rights Reserved (
www.mak.com
)