VR-Forces Developer's Guide
 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/tdbUnits.h"
18 #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 
122  virtual void setLocalDelivery(bool);
123  virtual bool localDelivery() const;
124 
135  static DtSimCommand * createSimCommand(DtlObjPtr mtlStream);
136  static DtSimCommand * createSimCommand(const DtSimCommandMessageType& simCommandType);
137 
139  static DtSimCommand* createFromFactory(const DtSimCommandMessageType& simCommandType) { return createSimCommand(simCommandType); };
141  typedef DtSimCommandMessageType FactoryKeyType;
142 
144  static void addSimCommandCreatorFcn(const DtSimCommandMessageType& simCommandName,
146 
147  static void setFactory(DtSimCommandFactory * factory);
148  static DtSimCommandFactory* factory();
149 
150 protected:
151  virtual char* createNetworkBuffer();
152  virtual bool isTypeRegistered(const DtSimCommandMessageType& commandType);
153 
154 protected:
155  char* myNetRep;
158 };
159 
161 
162 namespace DtBufferSerialize
163 {
166  DT_DLL_vrfplan int getSize(const DtSimCommand* const& commandPtr);
167 
172  DT_DLL_vrfplan char *encode(const DtSimCommand* const& commandPtr, char *buffer);
173 
182  DT_DLL_vrfplan const char *decode(DtSimCommand*& commandPtr, const char *buffer);
183 }
184 
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)
Deriving class overrides these to get/put class specific data.
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:155
Definition: readerWriterRegistry.h:39
static DtReaderWriterFactory * factory()
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
bool myLocalDelivery
Definition: simCommand.h:157
DtSimCommand is an abstract base class from which commands can derive. It manages the read/write capa...
Definition: simCommand.h:32
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
DtRwFactoryItemList< DtSimCommand > DtSimCommandList
Definition: simCommand.h:160
DtSimCommand *(* DtSimCommandCreatorFcn)()
Definition: simCommandFactory.h:20
Templated RW list which contains items generated from a factory all sharing the same parent type...
Definition: rwFactoryItemList.h:26
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:156

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)