VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
setSpeedAndHeading.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: setSpeedAndHeading.h,v $ $Revision: 1.3 $ $State: Exp $
7 *******************************************************************************/
8 #pragma once
9 
11 #include <vlpi/netStructs.h>
12 #include <readerWriter/rwReal.h>
14 
15 namespace vrfAddSetExample
16 {
17  //class DtSetSpeedAndHeadingRequest:
18  //
19  //Instances of DtSetSpeedAndHeading are an example of a new kind of set that tells
20  //an entity to set their current speed and heading.
21 
22  //DtSetSpeedAndHeadingString must be a unique string representing the set
23  //(existing string types are defined in msgTypes.h).
24  const DtSetMessageType DtSetSpeedAndHeadingType("set-speed-and-heading");
25 
26  //DtSetSpeedAndHeadingMenuItemIdName must be a unique string identifying the
27  //DtSetSpeedAndHeadingMenuItem object, which inherits from DtVrfTaskSetMenuItem
28  const char DtSetSpeedAndHeadingMenuItemIdName[] = "DtSetSpeedAndHeadingMenuItem";
29 
31  {
32 
33  public:
34 
35  //default constructor
37 
38  //constructor;
39  //If you have a request 'put' itself, the writeName will preface it.
40  DtSetSpeedAndHeadingRequest(const DtString & writeName,
41  DtReaderWriterRegistry * parentRegistry = 0);
42 
43  //copy constructor
45  orig, DtReaderWriterRegistry * parentRegistry = 0);
46 
47  //assignment operator
49 
51 
52  //Returns DtSetSpeedAndHeadingRequestType.
53  virtual const DtSetMessageType& type() const;
54 
55  //Creates a copy of the request.
56  virtual DtSetDataRequest * clone(const DtString & name,
57  DtReaderWriterRegistry * parentRegistry = 0) const;
58 
59  //Get a readable string representation of this setDataRequest.
60  virtual DtString stringRep() const;
61 
62  //In meters/second.
63  virtual DtReal speed() const;
64  virtual void setSpeed(DtReal speed);
65 
66  //In radians
67  virtual DtReal heading() const;
68  virtual void setHeading(DtReal heading);
69 
70  //Returns the size of the full network representation
71  //padded to an 8-byte boundary.
72  virtual int netRepSize() const;
73 
74  //Fills in the task from the network buffer.
75  virtual bool setFromNet(const char* contentBuffer,
76  unsigned contentSize);
77 
78  //Fills in the network buffer (created by base class setDataRequest) with
79  //the set data request contents.
80  virtual bool setToNet();
81 
82  static DtSetDataRequest * creator();
83 
84  protected:
85 
88  };
89 }
90 
91 
const DtSetMessageType DtSetSpeedAndHeadingType("set-speed-and-heading")
DtRwReal myHeading
Definition: setSpeedAndHeading.h:87
Definition: readerWriterRegistry.h:39
Definition: setSpeedAndHeading.h:30
DtRwReal mySpeed
Definition: setSpeedAndHeading.h:86
virtual const DtSetMessageType & type() const
What kind of setDataRequest am I? (from radioMsgTypes.h).
DtSetDataRequest is an abstract base class from which real setDataRequests can derive.
Definition: setDataRequest.h:40
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets the contents of this set request based on the network buffer.
const char DtSetSpeedAndHeadingMenuItemIdName[]
Definition: setSpeedAndHeading.h:28
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
const DtSetSpeedAndHeadingRequest & operator=(const DtSetSpeedAndHeadingRequest &orig)
virtual bool setToNet()
Sets netRep buffer to the contents of this set request.
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
virtual void setHeading(DtReal heading)
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
virtual DtSetDataRequest * clone(const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const
Make a copy of this request.
virtual DtString stringRep() const
Get a readable string representation of this setDataRequest.

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)