MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
callResponseMessage.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2025 MAK Technologies
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
7 #include "fedproMessage.h"
8 
9 #include <map>
10 
11 namespace rti1516_2025
12 {
13  namespace fedpro
14  {
15  class CallResponse;
16  };
17 };
18 
19 namespace FedProSess
20 {
22  {
23  public:
24 
25  // Create a message from the response data
26  // Allocates memory for in place construction of the message to hold its fixed and variable length data.
27  // User is responsible for calling destroy to free memory
28  static DtCallResponseMessage* create(const rti1516_2025::fedpro::CallResponse& responseData = theDefaultResponse);
29 
30  // Create a message from the response data using the supplied buffer (resized if needed).
31  static DtCallResponseMessage* create(std::vector<char>& messageBuffer,
32  const rti1516_2025::fedpro::CallResponse& responseData = theDefaultResponse);
33 
34  // Clone the given message
35  // Allocates memory for in place construction of the message to hold its fixed and variable length data.
36  // User is responsible for calling destroy to free memory
37  static DtCallResponseMessage* clone(const DtCallResponseMessage* originalMessage);
38 
39  // Clone the given message using the supplied buffer (resized if needed).
40  static DtCallResponseMessage* clone(std::vector<char>& messageBuffer, const DtCallResponseMessage* originalMessage);
41 
42  public:
43 
45 
46  DtCallResponseMessage* setRequestNumber(DtFedProU32 statusValue);
47  DtFedProU32 requestNumber() const;
48 
49  bool getResponse(rti1516_2025::fedpro::CallResponse& response) const;
50 
51  void printData() const;
52  const char* responseString() const;
53  static const char* responseString(const rti1516_2025::fedpro::CallResponse& response);
54  static const char* responseString(unsigned int responseType);
55  protected:
56 
57  // Must use create
58  DtCallResponseMessage(unsigned long messageSize);
59 
60  // Set the message payload data
61  void setResponse(const rti1516_2025::fedpro::CallResponse& responseData);
62 
63  // Size of this message minus the data placeholder for variable length serialized data
64  static inline unsigned fixedMessageSize() {return sizeof(DtCallResponseMessage) - 1;}
65 
66  protected:
67 
69  // Place holder for serialized data
70  char myData;
71 
72  static std::map <int, const char*> theResponseStrings;
74 
75  };
76 
77 }
78 
MAKRti::DtNetU32 DtFedProU32
Definition: fedproNetDatatypes.h:15
#define DT_DLL_FEDPRO
Definition: rtiMsConfig.h:156
static rti1516_2025::fedpro::CallResponse const & theDefaultResponse
Definition: callResponseMessage.h:73
static std::map< int, const char * > theResponseStrings
Definition: callResponseMessage.h:72
char myData
Definition: callResponseMessage.h:70
static unsigned fixedMessageSize()
Definition: callResponseMessage.h:64
DtFedProU32 myRequestNumber
Definition: callResponseMessage.h:68
Definition: callResponseMessage.h:21
Definition: fedproMessage.h:18
Definition: RTIambassador.pb.h:56904

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)