VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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"
11 #include <readerWriter/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.
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 
27  {
28  public:
29 
30  //default constructor
32 
33  //real constructor
35 
36  //copy constructor
38  DtReaderWriterRegistry* parentRegistry = NULL);
39 
40  //destructor
41  virtual ~MyConditionalExpression();
42 
43  //assignment operator
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
96 
97  //The modifier (set via the "Any" checkbox in the GUI)
99  };
100 
101 }
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual int type() const
Returns the type of conditional expression defined in condExprTypes.h.
MyConditionalExpression & operator=(const MyConditionalExpression &orig)
const int DtCondExprFacingNorthType
Definition: conditionalExpression.h:20
Definition: conditionalExpression.h:26
DtRwString myModifier
Definition: conditionalExpression.h:98
virtual DtString stringRep(int subExprIndex=DtSR_EXPR) const
Get a readable string representation of this level of this expression.
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Definition: readerWriterRegistry.h:39
Contains the DtUUID class declaration.
virtual void setModifier(const DtString &arg)
uuid class
Definition: rwUUID.h:26
virtual void setEntity(const DtUUID &name)
virtual const DtString & modifier() const
static const int DtSR_EXPR
A constant for use as the subExprIndex argument to stringRep().
Definition: simCondExpr.h:116
virtual int netRepSize() const
These 3 should become pure virtual functions.
virtual const DtUUID & entity() const
const char DtCeFacingNorthTypeName[]
Definition: conditionalExpression.h:24
virtual DtSimCondExpr * clone(DtReaderWriterRegistry *parentRegistry=NULL) const
clone operator
DtSimCondExpr is an abstract base class representing various Conditional Expressions used by the Plan...
Definition: simCondExpr.h:53
DtRwUUID myEntity
Definition: conditionalExpression.h:95
const int MIN_USER_CONDITIONAL_EXPRESSION_TYPE
File: condExprTypes.h.
Definition: condExprTypes.h:17
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)