VR-Forces 4.5 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
examples
addConditional
addConditionalSim
conditionalExpression.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2014 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
6
#pragma once
7
8
#include "
vrfutil/simCondExpr.h
"
9
#include "
vrfutil/condExprTypes.h
"
10
#include "
vrfutil/readerWriter.h
"
11
#include "
vrfutil/rwString.h
"
12
#include "
vrfutil/rwUUID.h
"
13
14
namespace
vrfAddConditionalExample
15
{
16
//This is the integer type which represents MyConditionalExpression on
17
//the network. By starting conditional expression types from
18
//MIN_USER_CONDITIONAL_EXPRESSION_TYPE, defined in condExprTypes.h, conflicts
19
//with existing VR-Forces types can be avoided.
20
const
int
DtCondExprFacingNorthType
=
MIN_USER_CONDITIONAL_EXPRESSION_TYPE
+ 1;
21
22
//This is the string type which represents MyConditionalExpression in
23
//plan files. It must not contain any spaces.
24
const
char
DtCeFacingNorthTypeName
[] =
"FacingNorth"
;
25
26
class
MyConditionalExpression
:
public
DtSimCondExpr
27
{
28
public
:
29
30
//default constructor
31
MyConditionalExpression
();
32
33
//real constructor
34
MyConditionalExpression
(
DtReaderWriterRegistry
* parentRegistry);
35
36
//copy constructor
37
MyConditionalExpression
(
const
MyConditionalExpression
& orig,
38
DtReaderWriterRegistry
* parentRegistry = NULL);
39
40
//destructor
41
virtual
~MyConditionalExpression
();
42
43
//assignment operator
44
MyConditionalExpression
&
operator=
(
const
MyConditionalExpression
& orig);
45
46
//clone operator
47
virtual
DtSimCondExpr
*
clone
(
DtReaderWriterRegistry
* parentRegistry = NULL)
const
;
48
49
//Returns DtNetCeFacingNorthType (defined above).
50
virtual
int
type
()
const
;
51
52
//Set the entity
53
virtual
void
setEntity
(
const
DtUUID
&
name
);
54
//Returns the entity
55
virtual
const
DtUUID
&
entity
()
const
;
56
57
//Set the test modifier.
58
// If it is an empty string, checks only the specified entity.
59
// If it is the string "ANY", checks all subordinate entities to see if
60
// any of them match the test,
61
// If it is neither of the above, it requires that all specified entities
62
// match.
63
virtual
void
setModifier
(
const
DtString
& arg);
64
//Returns the modifier
65
virtual
const
DtString
&
modifier
()
const
;
66
67
//Get a readable string representation of this level of this expression.
68
//
69
//The subExprIndex argument indicates which stringRep to get if this
70
//expression can have sub-expressions. Since the facing north test has
71
//no sub-expressions, it only returns a string representation if passed an
72
//index of DtSimCondExpr::DtSR_EXPR.
73
//
74
//See the documentation for DtSimCondExpr::stringRep for more
75
//information.
76
virtual
DtString
stringRep
(
int
subExprIndex =
DtSR_EXPR
)
const
;
77
78
//returns the size of the full network representation
79
//padded to an 8-byte boundary.
80
virtual
int
netRepSize
()
const
;
81
82
//Fills in the expression from the network buffer
83
virtual
bool
setFromNet
(
const
char
* contentBuffer,
84
unsigned
contentSize);
85
86
//Fills in the network buffer (created by base class conditional
87
//expression) with the conditional expression contents.
88
virtual
bool
setToNet
();
89
90
//Returns a new MyConditionalExpression
91
static
DtSimCondExpr
*
creator
();
92
93
protected
:
94
//The name of the entity to evaluate
95
DtRwUUID
myEntity
;
96
97
//The modifier (set via the "Any" checkbox in the GUI)
98
DtRwString
myModifier
;
99
};
100
101
}
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)