VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
simCommand.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 
10 #pragma once
11 
14 //#include "vrfutil/strIntMapper.h"
15 #include <readerWriter/rwBoolean.h>
16 #include <vlutil/vlNetTypes.h>
17 #include "tdbutil/unitFormatter.h"
18 #include "tdbutil/tdbUnits.h"
19 #include "vrfplan/vrfplanDefines.h"
20 
21 class DtRwString;
23 
31 
33 {
34 protected:
37 
39  DtSimCommand();
40 
43  DtSimCommand(const DtString & writeName,
44  DtReaderWriterRegistry * parentRegistry = 0);
45 
47  DtSimCommand(const DtString & writeName, const DtSimCommand & orig,
48  DtReaderWriterRegistry * parentRegistry = 0);
49 
51  const DtSimCommand & operator=(const DtSimCommand & orig);
52 
53 public:
54 
56  virtual ~DtSimCommand();
57 
60  virtual bool init();
61 
66  virtual const DtSimCommandMessageType& type() const = 0;
67 
72  virtual DtSimCommand * clone(const DtString & name, DtReaderWriterRegistry *
73  parentRegistry = 0) const = 0;
74 
77  virtual DtSimCommand* clone() const;
78 
84  virtual DtString stringRep() const = 0;
85 
88  virtual void putData(std::string& fp, int indentLevel = 0);
89 
92  virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
93  const DtVariableBindingsList& variableBindings);
94 
95  virtual char* netRep();
96 
102  virtual int netRepSize() const;
103 
108  virtual bool setFromNet(const char* contentBuffer,
109  unsigned contentSize);
110 
118  virtual bool setToNet();
119 
120 
131  static DtSimCommand * createSimCommand(DtlObjPtr mtlStream);
132  static DtSimCommand * createSimCommand(const DtSimCommandMessageType& simCommandType);
133 
135  static void addSimCommandCreatorFcn(const DtSimCommandMessageType& simCommandName,
137 
138  static void setFactory(DtSimCommandFactory * factory);
139  static DtSimCommandFactory* factory();
140 
141 protected:
142  virtual char* createNetworkBuffer();
143  virtual bool isTypeRegistered(const DtSimCommandMessageType& commandType);
144 
145 protected:
146  char* myNetRep;
148 };
149 
150 namespace DtBufferSerialize
151 {
154  DT_DLL_vrfplan int getSize(const DtSimCommand* const& commandPtr);
155 
160  DT_DLL_vrfplan char *encode(const DtSimCommand* const& commandPtr, char *buffer);
161 
170  DT_DLL_vrfplan const char *decode(DtSimCommand*& commandPtr, const char *buffer);
171 }
172 
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
virtual DtlObjPtr getData(DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
Definition: readerWriter.h:85
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
char * myNetRep
Definition: simCommand.h:146
Definition: readerWriterRegistry.h:39
static DtReaderWriterFactory * factory()
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
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer.
DtSimCommand *(* DtSimCommandCreatorFcn)()
Definition: simCommandFactory.h:20
virtual void putData(std::string &fp, int indentLevel=0)
Deriving class overrides these to get/put class specific data.
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
#define DT_DLL_vrfplan
This file is used to determine how to build.
Definition: vrfplanDefines.h:28
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
DtSimCommandFactory is a hashlist of DtTaskFactoryEntrys, indexed by the string type that represents ...
Definition: simCommandFactory.h:25
static DtSimCommandFactory * myFactory
Definition: simCommand.h:147

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)