VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
setEncumbranceRequest.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 VT MAK, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
7 
9 
10 #pragma once
11 
13 #include <vlpi/netStructs.h>
14 #include <readerWriter/rwReal.h>
16 
17 namespace vrfAddSetEncumbranceExample
18 {
19  //class DtSetEncumbranceRequest:
20  //
21  //Instances of DtSetEncumbrance send a payload mass value to DtManualRotaryWingEncumberedFlightActuator.
22 
23  //DtSetEncumbranceString must be a unique string representing the set
24  //(existing string types are defined in msgTypes.h).
25  const DtSetMessageType DtSetEncumbranceType("set-encumbrance");
26 
27  //DtSetEncumbranceMenuItemIdName must be a unique string identifying the
28  //DtSetEncumbranceMenuItem object, which inherits from DtVrfTaskSetMenuItem
29  const char DtSetEncumbranceMenuItemIdName[] = "DtSetEncumbranceMenuItem";
30 
32  {
33 
34  public:
35 
36  //default constructor
38 
39  //constructor;
40  //If you have a request 'put' itself, the writeName will preface it.
41  DtSetEncumbranceRequest(const DtString & writeName,
42  DtReaderWriterRegistry * parentRegistry = 0);
43 
44  //copy constructor
46  orig, DtReaderWriterRegistry * parentRegistry = 0);
47 
48  //assignment operator
50 
51  virtual ~DtSetEncumbranceRequest() override;
52 
53  //Returns DtSetEncumbranceRequestType.
54  virtual const DtSetMessageType& type() const override;
55 
56  //Creates a copy of the request.
57  virtual DtSetDataRequest * clone(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0) const override;
58 
59  //Get a readable string representation of this setDataRequest.
60  virtual DtString stringRep() const override;
61 
64  virtual DtReal encumbrance() const;
65  virtual void setEncumbrance(DtReal kgs);
67 
68  //Returns the size of the full network representation
69  //padded to an 8-byte boundary.
70  virtual int netRepSize() const override;
71 
72  //Fills in the task from the network buffer.
73  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
74 
75  //Fills in the network buffer (created by base class setDataRequest) with
76  //the set data request contents.
77  virtual bool setToNet() override;
78 
79  static DtSetDataRequest * creator();
80 
81  protected:
82 
84  };
85 }
86 
87 
DtRwReal myEncumbrance
Definition: setEncumbranceRequest.h:83
const char DtSetEncumbranceMenuItemIdName[]
Definition: setEncumbranceRequest.h:29
const DtSetEncumbranceRequest & operator=(const DtSetEncumbranceRequest &orig)
virtual DtSetDataRequest * clone(const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const override
Make a copy of this request. Returns a pointer to a newly created copy of this data request...
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize) override
Sets the contents of this set request based on the network buffer. Base class does nothing and return...
virtual void setEncumbrance(DtReal kgs)
Encumbrance in kilograms.
virtual DtReal encumbrance() const
Encumbrance in kilograms.
Definition: readerWriterRegistry.h:39
DtSetDataRequest is an abstract base class from which real setDataRequests can derive. It manages the read/write capability; derived classes need only use and register read/writatble data types for derived information.
Definition: setDataRequest.h:41
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
const DtSetMessageType DtSetEncumbranceType("set-encumbrance")
virtual const DtSetMessageType & type() const override
What kind of setDataRequest am I? (from radioMsgTypes.h). Returns a string representing the kind of d...
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
Definition: setEncumbranceRequest.h:31
virtual DtString stringRep() const override
Get a readable string representation of this setDataRequest. Returns a human readable string represen...
virtual DtSymbolString name() const
Accessor for name of this readable/writable object.
virtual bool setToNet() override
Sets netRep buffer to the contents of this set request. Base class does nothing and returns true...

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)