MAK Data Logger API Documentation for HLA
 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 };

Document ID: Generated on Thu Jul 23 15:05:27 EDT 2020 from SVN revision 215371
Copyright © 2020 MAK Technologies. All Rights Reserved (www.mak.com)