MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
callbackRequestMessage.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 CallbackRequest;
16  };
17 };
18 
19 namespace FedProSess
20 {
22  {
23  public:
24 
25  // Create a message from the callback 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 DtCallbackRequestMessage* create(const rti1516_2025::fedpro::CallbackRequest& callbackData);
29 
30  // Create a message from the callback data using the supplied buffer (resized if needed).
31  static DtCallbackRequestMessage* create(std::vector<char>& messageBuffer,
32  const rti1516_2025::fedpro::CallbackRequest& callbackData);
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 DtCallbackRequestMessage* clone(const DtCallbackRequestMessage* originalMessage);
38 
39  // Clone the given message using the supplied buffer (resized if needed).
40  static DtCallbackRequestMessage* clone(std::vector<char>& messageBuffer, const DtCallbackRequestMessage* originalMessage);
41 
42  public:
43 
45 
46  bool getRequest(rti1516_2025::fedpro::CallbackRequest& request) const;
47 
48  void printData() const;
49  const char* requestString() const;
50  static const char* requestString(const rti1516_2025::fedpro::CallbackRequest& request);
51  static const char* requestString(unsigned int requestType);
52 
53  protected:
54 
55  // Must use create or clone
56  DtCallbackRequestMessage(unsigned long messageSize);
57 
58  // Set the message payload data
59  void setRequest(const rti1516_2025::fedpro::CallbackRequest& callbackData);
60 
61  // Size of the fixed part of this message minus the data placeholder for variable length serialized data
62  static inline unsigned fixedMessageSize() {return sizeof(DtCallbackRequestMessage) - 1;}
63 
64  protected:
65 
66  // Place holder for serialized data
67  char myData;
68 
69  static std::map <int, const char*> theRequestStrings;
70  };
71 }
Definition: callbackRequestMessage.h:21
#define DT_DLL_FEDPRO
Definition: rtiMsConfig.h:156
static std::map< int, const char * > theRequestStrings
Definition: callbackRequestMessage.h:69
static unsigned fixedMessageSize()
Definition: callbackRequestMessage.h:62
Definition: FederateAmbassador.pb.h:11165
char myData
Definition: callbackRequestMessage.h:67
Definition: fedproMessage.h:18

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)