VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mySimCommand.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 
7 //\file consoleMessageCommand.h
8 //\brief DtConsoleMessageCommand.
9 
10 #pragma once
11 
12 #include "vrfplan/simCommand.h"
13 #include <readerWriter/rwString.h>
14 #include <vlutil/vlPrint.h>
16 
17 const DtSimCommandMessageType MySimCommandType("my-sim-command");
18 
19 //\brief DtSimCommand which causes a console message to be printed.
20 //This command will simply print a message to the back-end console
21 
22 class MySimCommand : public DtSimCommand
23 {
24 public:
25  //Default constructor
26  MySimCommand();
27 
28  //Usual constructor
29  MySimCommand(const DtString& writeName,
30  DtReaderWriterRegistry* parentRegistry = NULL);
31 
32  //copy constructor
33  MySimCommand(const DtString & writeName, const MySimCommand& orig,
34  DtReaderWriterRegistry* parentRegistry = NULL);
35 
36  //destructor
37  virtual ~MySimCommand();
38 
39  //assignment operator
40  MySimCommand& operator=(const MySimCommand& orig);
41 
42  //\return MySimCommandType.
43  const DtSimCommandMessageType& type() const;
44 
45  //\return A new instance of this class, copied from the original.
47  parentRegistry = 0) const;
48 
49  //Message to print to console
51  virtual DtString messageText() const;
52  virtual void setMessageText(const DtString& text);
54 
55  //Text representation of this command.
56  virtual DtString stringRep() const;
57 
58  //\copydoc DtSimCommand::netRepSize()
59  virtual int netRepSize() const;
60 
61  //\copydoc DtSimCommand::setFromNet()
62  virtual bool setFromNet(const char* contentBuffer,
63  unsigned contentSize);
64 
65  //\copydoc DtSimCommand::setToNet()
66  virtual bool setToNet();
67 
68  //Returns a new instance of this class.
69  static DtSimCommand* creator();
70 
71 protected:
73 };
74 
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
virtual void setMessageText(const DtString &text)
MySimCommand & operator=(const MySimCommand &orig)
virtual bool setToNet()
Calls netRep() to create the network buffer.
static DtSimCommand * creator()
Definition: mySimCommand.h:22
virtual DtString messageText() const
virtual DtString stringRep() const
Returns a human-readable string representation of the command.
const DtSimCommandMessageType MySimCommandType("my-sim-command")
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
DtSimCommand is an abstract base class from which commands can derive.
Definition: simCommand.h:32
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets mySubsimCommand member from the incoming contentBuffer (cast to type DtNetSimSimCommand).
virtual DtSimCommand * clone() const
Version of clone that preserves the existing name, and assigns a null parent registry.
virtual int netRepSize() const
Returns the size in bytes of the network representation of the class.
const DtSimCommandMessageType & type() const
DtRwString myMessageText
Definition: mySimCommand.h:72
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
virtual ~MySimCommand()

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)