WSF
WsfXIO_MessageService.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFXIO_MESSAGEREQUEST_HPP
13#define WSFXIO_MESSAGEREQUEST_HPP
14
15#include "wsf_export.h"
16
17#include <map>
18#include <vector>
19
20#include "WsfComm.hpp"
21class WsfMessage;
22class WsfSimulation;
28
31{
32public:
34 int aPlatformIndex,
35 bool aReceivedMessages,
36 bool aTransmittedMessages,
37 bool aIsReliable = true);
38
40 virtual void HandleMessage(WsfXIO_MessagePkt& aPkt) = 0;
41
42
43private:
44 void HandleMessagePrivate(WsfXIO_MessagePkt& aPkt);
45
46 void Initialized() override;
47
48 UtCallbackHolder mCallbacks;
49 int mPlatformIndex;
50 bool mGetReceived;
51 bool mGetTransmitted;
52};
53
56{
57public:
59
60protected:
62
63 void SubscriptionCancelled(WsfXIO_Subscription* aSubscriptionPtr) override;
64
65 void HandleReceivedMessage(double aSimTime,
66 wsf::comm::Comm* aXmtrCommPtr,
67 wsf::comm::Comm* aReceiverCommPtr,
68 const WsfMessage& aMessage,
69 wsf::comm::Result& aResult);
70
71 void HandleTransmittedMessage(double aSimTime, wsf::comm::Comm* aXmtrCommPtr, const WsfMessage& aMessage);
72
73 void HandleTransmitEndedMessage(double aSimTime, wsf::comm::Comm* aXmtrCommPtr, const WsfMessage& aMessage);
74
75 void HandleTransmittedHeartbeatMessage(double aSimTime, wsf::comm::Comm* aXmtrCommPtr, const WsfMessage& aMessage);
76
77 void HandleMessage(WsfPlatform* aPlatformPtr, const WsfMessage& aMessage, bool aIsReceived);
78
79 void UpdateCallbacks();
80
82 UtCallbackHolder mObserverCallbacks;
83 typedef std::vector<WsfXIO_Subscription*> SubscriptionList;
84 typedef std::map<size_t, SubscriptionList> SubscriptionsMap;
87};
88
89#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
A base class for messages sent among simulation communication objects, processors and sensors.
Definition WsfMessage.hpp:33
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfXIO_Connection.hpp:37
Provides messages associated with a WsfXIO_MessageRequestPkt.
Definition WsfXIO_SimPacketRegistry.hpp:61
Requests messages sent or received by a platform.
Definition WsfXIO_PacketRegistry.hpp:895
WsfXIO_MessageRequest(WsfXIO_Connection *aConnectionPtr, int aPlatformIndex, bool aReceivedMessages, bool aTransmittedMessages, bool aIsReliable=true)
Definition WsfXIO_MessageService.cpp:41
virtual void HandleMessage(WsfXIO_MessagePkt &aPkt)=0
Override this method to handle messages.
void SubscriptionCancelled(WsfXIO_Subscription *aSubscriptionPtr) override
Definition WsfXIO_MessageService.cpp:101
WsfSimulation & mSimulation
Definition WsfXIO_MessageService.hpp:81
SubscriptionsMap mTransmitSubscribers
Definition WsfXIO_MessageService.hpp:86
std::vector< WsfXIO_Subscription * > SubscriptionList
Definition WsfXIO_MessageService.hpp:83
SubscriptionsMap mReceiveSubscribers
Definition WsfXIO_MessageService.hpp:85
void HandleMessage(WsfPlatform *aPlatformPtr, const WsfMessage &aMessage, bool aIsReceived)
Definition WsfXIO_MessageService.cpp:172
UtCallbackHolder mObserverCallbacks
Definition WsfXIO_MessageService.hpp:82
void HandleTransmitEndedMessage(double aSimTime, wsf::comm::Comm *aXmtrCommPtr, const WsfMessage &aMessage)
Definition WsfXIO_MessageService.cpp:161
void HandleRequest(WsfXIO_MessageRequestPkt &aPkt)
Definition WsfXIO_MessageService.cpp:83
void HandleTransmittedHeartbeatMessage(double aSimTime, wsf::comm::Comm *aXmtrCommPtr, const WsfMessage &aMessage)
Definition WsfXIO_MessageService.cpp:165
void UpdateCallbacks()
Definition WsfXIO_MessageService.cpp:128
std::map< size_t, SubscriptionList > SubscriptionsMap
Definition WsfXIO_MessageService.hpp:84
void HandleTransmittedMessage(double aSimTime, wsf::comm::Comm *aXmtrCommPtr, const WsfMessage &aMessage)
Definition WsfXIO_MessageService.cpp:156
void HandleReceivedMessage(double aSimTime, wsf::comm::Comm *aXmtrCommPtr, wsf::comm::Comm *aReceiverCommPtr, const WsfMessage &aMessage, wsf::comm::Result &aResult)
Definition WsfXIO_MessageService.cpp:147
WsfXIO_MessageService(WsfXIO_Simulation &aXIO_Simulation)
Definition WsfXIO_MessageService.cpp:76
virtual void Initialized()=0
WsfXIO_Request(WsfXIO_Connection *aConnectionPtr, bool aIsReliable=true)
Definition WsfXIO_Request.cpp:160
WsfXIO_Service(WsfXIO_Interface *aInterfacePtr)
Definition WsfXIO_Service.cpp:21
Definition WsfXIO_Simulation.hpp:49
A WsfXIO_Subscription wraps information about a remote request for information.
Definition WsfXIO_Subscription.hpp:30
Definition WsfComm.hpp:43
Definition WsfCommResult.hpp:34
Copyrights Multiple, All Rights Reserved