VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
registerTriggerStatement.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfplan/vrfplanDefines.h"
12 #include "vrfplan/simStatement.h"
13 #include <readerWriter/rwBoolean.h>
14 #include "vrfutil/rwUUID.h"
15 
16 const char DtRegisterTriggerStatementTypeName[] = "RegisterTrigger";
17 const char DtUnregisterTriggerStatementTypeName[] = "UnregisterTrigger";
18 
19 class DtRwCondExpr;
20 class DtTriggerBlock;
21 class DtSimCondExpr;
22 class DtTriggerStmt;
23 
33 {
34 public:
35 
37  DtRegisterTriggerStatement(DtReaderWriterRegistry* parentRegistry = NULL);
38 
41  DtReaderWriterRegistry* parentRegistry = NULL);
42 
44  virtual ~DtRegisterTriggerStatement();
45 
48 
50  virtual DtSimStatement* clone(
51  DtReaderWriterRegistry* parentRegistry = NULL) const;
52 
54  virtual void setTriggerUUID(const DtUUID&);
55  virtual const DtUUID& triggerUUID() const;
56 
58  virtual DtString triggerName() const;
59 
60  virtual void setTriggerStatement(DtTriggerStmt*);
61  virtual DtTriggerStmt* triggerStatement() const;
62 
64  virtual bool registerTrigger() const;
65 
66  virtual int subBlockCount() const;
67  virtual DtSimBlock* subBlock(int index);
68 
70  virtual bool reregisterTrigger() const;
71 
73  virtual void mapTriggerStatement(DtPlan& planContext);
74 
77  virtual void execute(DtPlan& planContext);
78 
80  virtual DtString stringRep(int) const;
81 
83  virtual int type() const;
84 
87  virtual int netRepSize() const;
88 
90  virtual bool setFromNet(const char* contentBuffer,
91  unsigned contentSize);
92 
104  virtual bool setToNet();
105 
107  virtual const DtSimCondExpr* condExpr() const;
108 
110  virtual const DtString& option() const;
111 
113  virtual DtTriggerBlock* triggerBlock() const;
114 
115  virtual void upgradeTriggerUUID(const boost::unordered_map<DtUUID, DtUUID>&);
116 
117 public:
119  static DtSimStatement* creator(DtReaderWriterRegistry* parentRegistry=NULL);
120 
121 protected:
122  DtRegisterTriggerStatement(const DtString& statementType, DtReaderWriterRegistry* parentRegistry = NULL);
123 
124 protected:
128 };
129 
132 {
133 public:
134 
137 
140  DtReaderWriterRegistry* parentRegistry = NULL);
141 
143  virtual ~DtUnregisterTriggerStatement();
144 
146  virtual DtSimStatement* clone(
147  DtReaderWriterRegistry* parentRegistry = NULL) const;
148 
150  virtual int type() const;
151 
152 public:
154  static DtSimStatement* creator(DtReaderWriterRegistry* parentRegistry=NULL);
155 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
virtual DtSimStatement * clone(DtReaderWriterRegistry *parentRegistry=NULL) const =0
virtual copy constructor A typical clone function. It must be overridden by derived classes to return...
virtual int subBlockCount() const
Get the number of blocks nested inside this statement.
DtTriggerStmt * myTriggerStatement
Definition: registerTriggerStatement.h:127
DtRwBoolean myRegister
Definition: registerTriggerStatement.h:126
virtual void execute(DtPlan &planContext)=0
Execute the current statement and make any changes to the Plan state as appropriate. Tells the statement to activate its own behavior. Each kind of statement implements this function differently. It is passed a reference to the executing DtPlan object as a “context of execution”.
Definition: readerWriterRegistry.h:39
Contains the DtUUID class declaration.
const char DtUnregisterTriggerStatementTypeName[]
Definition: registerTriggerStatement.h:17
virtual int type() const
Returns DtRegisterStatementType (defined in simStmtTypes.h)
Description: Readable, Writable uuid string. Use this class in order to convert from object marking t...
Definition: rwUUID.h:428
class DtSimBlock:
Definition: simBlock.h:27
class DtRegisterTriggerStatement:
Definition: registerTriggerStatement.h:32
virtual DtSimBlock * subBlock(int index)
Get a pointer to any particular block nested inside this statement. Sub-blocks are indexed as C array...
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Extracts statement Id from buffer. First 16 bytes are a DtNetSimStatement structure. Derived class data should immediately follow this. Derived classes should call down to this one to make sure statement id gets set.
class DtTriggerBlock:
Definition: triggerBlock.h:26
virtual int netRepSize() const
Returns sizeof(DtNetSimStatement). Derived classes should add this size to the size of their net repr...
class DtPlan:
Definition: plan.h:92
DtSimCondExpr is an abstract base class representing various Conditional Expressions used by the Plan...
Definition: simCondExpr.h:53
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
class DtRwCondExpr:
Definition: rwCondExpr.h:26
class DtSimStatement:
Definition: simStatement.h:38
virtual bool setToNet()
Casts myNetRep to DtNetSimStatement* and fills in structure. Derived classes should always call down ...
virtual DtSimStatement * clone(DtReaderWriterRegistry *parentRegistry=NULL) const
virtual copy constructor
#define DT_DLL_vrfplan
This file is used to determine how to build.
Definition: vrfplanDefines.h:28
!!!!!!!! DtUnregisterTriggerStatement
Definition: registerTriggerStatement.h:131
DtRwUUID myTriggerUUID
Definition: registerTriggerStatement.h:125
Definition: triggerStmt.h:60
virtual void upgradeTriggerUUID(const boost::unordered_map< DtUUID, DtUUID > &)
For those statements that need to, map from the old to new trigger UUID.
DtSimStatement & operator=(const DtSimStatement &orig)
Assignment operator (protected because this is an abstract base class).
static DtSimStatement * creator(DtReaderWriterRegistry *parentRegistry=NULL)
Creator function to be registered with DtStatementFactory.
virtual int type() const =0
Returns the type of statement Type (defined in simStmtTypes.h)
const char DtRegisterTriggerStatementTypeName[]
Definition: registerTriggerStatement.h:16
virtual DtString stringRep(int subBlockIndex=DtSR_STMT) const =0
Get a readable string representation of this statement.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)