VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simCommandStmt.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 <vlutil/vlNetTypes.h>
14 
15 const char DtSimCommandStmtTypeName[] = "SimCommand";
16 
17 class DtSimCommand;
18 
22 {
23 public:
25  virtual ~DtSimCommandContext() {};
26 };
27 
28 typedef DtBoost::shared_ptr<DtSimCommandContext> DtSimCommandContextPtr;
29 
33 {
34 public:
36  DtSimCommandStmt(DtReaderWriterRegistry* parentRegistry = NULL);
37 
40  DtReaderWriterRegistry* parentRegistry = NULL);
41 
43  virtual ~DtSimCommandStmt();
44 
47 
49  virtual DtSimStatement* clone(
50  DtReaderWriterRegistry* parentRegistry = NULL) const;
51 
53  virtual int type() const;
54 
57  virtual void execute(DtPlan& planContext);
58 
66  virtual DtString stringRep(int subBlockIndex = DtSR_STMT) const;
67 
69  virtual DtSimCommand* simCommand() const;
70 
72  virtual void setSimCommand(DtSimCommand* arg);
73 
78  virtual void putSelf(std::string& fp, int indentLevel = 0,
79  bool writeUnspecified = false, const DtFilename& path = DtReaderWriter::appPath());
80 
83  virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
84  const DtVariableBindingsList& variableBindings);
85 
87  virtual int netRepSize() const;
88 
90  virtual bool setFromNet(const char* contentBuffer,
91  unsigned contentSize);
92 
95  virtual bool setToNet();
96 
97  static DtSimStatement * creator(DtReaderWriterRegistry* parentRegistry = NULL);
98 
101  virtual void step(DtPlan& planContext, bool forceStep);
102 
103 protected:
104 
107 };
Instances of DtSimCommandStmt represent a single sim-command in a DtPlan.
Definition: simCommandStmt.h:32
virtual ~DtSimCommandContext()
Definition: simCommandStmt.h:25
virtual DtSimStatement * clone(DtReaderWriterRegistry *parentRegistry=NULL) const =0
virtual copy constructor A typical clone function.
DtSimCommandContext()
Definition: simCommandStmt.h:24
virtual void step(DtPlan &planContext, bool forceStep=false)
Asks the statement to step the context DtPlan to the next statement.
virtual void execute(DtPlan &planContext)=0
Execute the current statement and make any changes to the Plan state as appropriate.
DtSimCommand * mySimCommand
Definition: simCommandStmt.h:105
Definition: readerWriterRegistry.h:39
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
DtSimCommand is an abstract base class from which commands can derive.
Definition: simCommand.h:32
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Extracts statement Id from buffer.
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
Top level to read itself from an input stream.
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file.
virtual int netRepSize() const
Returns sizeof(DtNetSimStatement).
class DtPlan:
Definition: plan.h:90
DtSimCommandContextPtr myCommandCompletionData
Definition: simCommandStmt.h:106
class DtSimStatement:
Definition: simStatement.h:41
virtual bool setToNet()
Casts myNetRep to DtNetSimStatement* and fills in structure.
#define DT_DLL_vrfplan
This file is used to determine how to build.
Definition: vrfplanDefines.h:28
const char DtSimCommandStmtTypeName[]
Definition: simCommandStmt.h:15
DtSimStatement & operator=(const DtSimStatement &orig)
Assignment operator (protected because this is an abstract base class).
An empty class that is used simply for the purposes of allowing command context executors to fill in ...
Definition: simCommandStmt.h:21
static const DtFilename & appPath()
Gets the current working directory.
virtual int type() const =0
Returns the type of statement Type (defined in simStmtTypes.h)
DtBoost::shared_ptr< DtSimCommandContext > DtSimCommandContextPtr
Definition: simCommandStmt.h:28
virtual DtString stringRep(int subBlockIndex=DtSR_STMT) const =0
Get a readable string representation of this statement.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)