MAK Data Logger API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lcCommand.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "lcPdu.h"
12 
13 typedef struct DtLgrCommandData
14 {
15  DtNetInt16 domain;
16  DtNetInt16 protocol;
17  DtNetInt16 command;
18  DtNetU16 pad1;
22 
24  + sizeof(DtLgrCommandData);
25 
26 typedef const char* (*DtDomainToStringFunc)(int domain);
27 typedef const char* (*DtProtocolToStringFunc)(int protocol);
28 typedef const char* (*DtCommandToStringFunc)(int domain, int command);
29 
34 {
35 public:
36 
38  DtLgrCommandPdu( DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );
39 
41  DtLgrCommandPdu( const DtNetLgrControlPdu* initial,
42  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0 );
43 
45  DtLgrCommandPdu( const DtEntityIdentifier& sender,
46  const DtEntityIdentifier& receiver, int domain, int protocol,
47  int commandId, const DtString& parametersBuffer, int pduSize=theCommandPduSize,
48  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER );
49 
51  virtual ~DtLgrCommandPdu();
52 
54  DtLgrCommandPdu( const DtLgrCommandPdu& src );
55 
58 
59  //@(
61  virtual int commandDomain() const;
62  virtual void setCommandDomain( int domain);
64 
65  //@(
67  virtual int commandProtocol() const;
68  virtual void setCommandProtocol( int protocol);
70 
71  //@(
73  virtual int command() const;
74  virtual void setCommand( int commandId);
76 
77  //@(
79  virtual const char* parametersBuffer() const;
80  virtual void setParametersBuffer(const DtString& paramsBuffer);
82 
84  virtual void printDataToStream(std::ostream& stream) const;
85 
87  virtual const char* commandString() const;
88 
90  virtual const char* domainString() const;
91 
93  virtual const char* protocolString() const;
94 
95 public:
96 
97  static void setDomainToString(DtDomainToStringFunc func);
98  static void setProtocolToString(DtProtocolToStringFunc func);
99  static void setCommandToString(DtCommandToStringFunc func);
100 
101 protected:
102 
104  virtual DtLgrCommandData* params() const;
105 
107  void initData();
108 
109 protected:
110 
114 };
const int theCommandPduSize
Definition: lcCommand.h:23
static DtDomainToStringFunc theDomainToStringFunc
Definition: lcCommand.h:111
DtNetInt16 command
Definition: lcCommand.h:17
const char *(* DtCommandToStringFunc)(int domain, int command)
Definition: lcCommand.h:28
Definition: lgrControlP.h:61
const char *(* DtDomainToStringFunc)(int domain)
Definition: lcCommand.h:26
struct DtLgrCommandData DtLgrCommandData
DtNetU16 parametersBuffOffset
Definition: lcCommand.h:20
Instances of DtLgrCommandPdu are to respond to a remote controller with the result of a logger comman...
Definition: lcCommand.h:33
const size_t theLgrControlPduSizeSansParams
Definition: lgrControlP.h:80
DtLgrControlPdu & operator=(const DtLgrControlPdu &src)
assignment operator
Instances of DtLgrControlPdu are a family of messages used to control a remote instance of the MAK-Lo...
Definition: lcPdu.h:139
DtNetInt16 protocol
Definition: lcCommand.h:16
static DtProtocolToStringFunc theProtocolToStringFunc
Definition: lcCommand.h:112
DtNetU16 pad1
Definition: lcCommand.h:18
DtNetU16 parametersBuffLength
Definition: lcCommand.h:19
Contains DtLgrControlPdu.
DtNetInt16 domain
Definition: lcCommand.h:15
const char *(* DtProtocolToStringFunc)(int protocol)
Definition: lcCommand.h:27
virtual void printDataToStream(std::ostream &stream) const
Print contents.
static DtCommandToStringFunc theCommandToStringFunc
Definition: lcCommand.h:113
Definition: lcCommand.h:13
#define DT_DLL_LOGGERCONTROL
Include vlconfig.h to get relivant platform info like if we need declspec stuff or not...
Definition: loggerControlDefines.h:31

Document ID: Generated on Thu Jul 14 15:45:33 EDT 2022 from SVN revision 244827
Copyright © 2021 MAK Technologies. All Rights Reserved (www.mak.com)