WSF
WsfUCI_Messages.hpp File Reference
#include "wsf_oms_uci_export.h"
#include "uci/base/accessorType.h"
#include "UtMemory.hpp"
#include "WsfDateTime.hpp"
#include "WsfPlatform.hpp"
#include "WsfSimulation.hpp"
#include "WsfUCI_Interface.hpp"
#include "WsfUCI_MessageBaseType.hpp"
#include "WsfUCI_MessageService.hpp"
#include "WsfUCI_Utils.hpp"
#include "uci/type/AMTI_Activity.h"
#include "uci/type/AMTI_ActivityType.h"
#include "uci/type/AMTI_Capability.h"
#include "uci/type/AMTI_CapabilityStatus.h"
#include "uci/type/AMTI_Command.h"
#include "uci/type/AMTI_CommandStatus.h"
#include "uci/type/AMTI_SettingsCommand.h"
#include "uci/type/AMTI_SettingsCommandStatus.h"
#include "uci/type/ControlRequest.h"
#include "uci/type/ControlRequestStatus.h"
#include "uci/type/ControlStatus.h"
#include "uci/type/DMPI.h"
#include "uci/type/DMPI_Status.h"
#include "uci/type/Entity.h"
#include "uci/type/ESM_Activity.h"
#include "uci/type/ESM_ActivityType.h"
#include "uci/type/ESM_Capability.h"
#include "uci/type/ESM_CapabilityStatus.h"
#include "uci/type/ESM_Command.h"
#include "uci/type/ESM_CommandStatus.h"
#include "uci/type/ESM_SettingsCommand.h"
#include "uci/type/ESM_SettingsCommandStatus.h"
#include "uci/type/POST_Activity.h"
#include "uci/type/POST_Capability.h"
#include "uci/type/POST_Command.h"
#include "uci/type/POST_CommandStatus.h"
#include "uci/type/POST_SettingsCommand.h"
#include "uci/type/POST_SettingsCommandStatus.h"
#include "uci/type/StrikeActivity.h"
#include "uci/type/StrikeCapability.h"
#include "uci/type/StrikeCapabilityStatus.h"
#include "uci/type/StrikeCommand.h"
#include "uci/type/StrikeCommandStatus.h"
#include "uci/type/SubsystemStatus.h"
#include "uci/type/SystemStatus.h"
#include "uci/factory/AMTI_ActivityFactory.h"
#include "uci/factory/AMTI_CapabilityFactory.h"
#include "uci/factory/AMTI_CapabilityStatusFactory.h"
#include "uci/factory/AMTI_CommandFactory.h"
#include "uci/factory/AMTI_CommandStatusFactory.h"
#include "uci/factory/AMTI_SettingsCommandFactory.h"
#include "uci/factory/AMTI_SettingsCommandStatusFactory.h"
#include "uci/factory/ControlRequestFactory.h"
#include "uci/factory/ControlRequestStatusFactory.h"
#include "uci/factory/ControlStatusFactory.h"
#include "uci/factory/DMPIFactory.h"
#include "uci/factory/DMPI_StatusFactory.h"
#include "uci/factory/EntityFactory.h"
#include "uci/factory/ESM_ActivityFactory.h"
#include "uci/factory/ESM_CapabilityFactory.h"
#include "uci/factory/ESM_CapabilityStatusFactory.h"
#include "uci/factory/ESM_CommandFactory.h"
#include "uci/factory/ESM_CommandStatusFactory.h"
#include "uci/factory/ESM_SettingsCommandFactory.h"
#include "uci/factory/ESM_SettingsCommandStatusFactory.h"
#include "uci/factory/POST_ActivityFactory.h"
#include "uci/factory/POST_CapabilityFactory.h"
#include "uci/factory/POST_CapabilityStatusFactory.h"
#include "uci/factory/POST_CommandFactory.h"
#include "uci/factory/POST_CommandStatusFactory.h"
#include "uci/factory/POST_SettingsCommandFactory.h"
#include "uci/factory/POST_SettingsCommandStatusFactory.h"
#include "uci/factory/StrikeActivityFactory.h"
#include "uci/factory/StrikeCapabilityFactory.h"
#include "uci/factory/StrikeCapabilityStatusFactory.h"
#include "uci/factory/StrikeCommandFactory.h"
#include "uci/factory/StrikeCommandStatusFactory.h"
#include "uci/factory/SubsystemStatusFactory.h"
#include "uci/factory/SystemStatusFactory.h"
#include "uci/reader/EntityReader.h"
#include "uci/reader/ESM_CapabilityReader.h"
#include "uci/reader/POST_ActivityReader.h"
#include "uci/reader/POST_CapabilityReader.h"
#include "uci/reader/POST_CommandReader.h"
#include "uci/reader/SubsystemStatusReader.h"
#include "uci/writer/EntityWriter.h"
#include "uci/writer/ESM_CapabilityWriter.h"
#include "uci/writer/ESM_CapabilityStatusWriter.h"
#include "uci/writer/POST_ActivityWriter.h"
#include "uci/writer/POST_CapabilityWriter.h"
#include "uci/writer/POST_CommandWriter.h"
#include "uci/writer/SubsystemStatusWriter.h"
Include dependency graph for WsfUCI_Messages.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  wsf::UCI_MessageType< Type, Factory, Reader, Writer, Listener, TypeName >
 Class parameterizing UCI message types. More...

Namespaces

namespace  wsf
 Function definitions for those who need run-time access to the version.

Macros

#define DEFINE_UCI_MESSAGE_TYPE(WSF_MESSAGE_TYPE, UCI_MESSAGE_TYPE, WSF_TYPE_NAME, UCI_ACCESSOR_NAME)

Macro Definition Documentation

◆ DEFINE_UCI_MESSAGE_TYPE

#define DEFINE_UCI_MESSAGE_TYPE ( WSF_MESSAGE_TYPE,
UCI_MESSAGE_TYPE,
WSF_TYPE_NAME,
UCI_ACCESSOR_NAME )
Value:
using WSF_MESSAGE_TYPE##Service = UCI_MessageService<uci::type::UCI_MESSAGE_TYPE, \
uci::factory::UCI_MESSAGE_TYPE##Factory, \
uci::reader::UCI_MESSAGE_TYPE##Reader, \
uci::writer::UCI_MESSAGE_TYPE##Writer, \
uci::reader::UCI_MESSAGE_TYPE##Listener>; \
\
class WSF_MESSAGE_TYPE : public UCI_MessageType<uci::type::UCI_MESSAGE_TYPE, \
uci::factory::UCI_MESSAGE_TYPE##Factory, \
uci::reader::UCI_MESSAGE_TYPE##Reader, \
uci::writer::UCI_MESSAGE_TYPE##Writer, \
uci::reader::UCI_MESSAGE_TYPE##Listener, \
uci::type::accessorType::UCI_ACCESSOR_NAME> \
{ \
public: \
explicit WSF_MESSAGE_TYPE(WsfPlatform* aPlatformPtr) : UCI_MessageType(aPlatformPtr) { SetType(GetTypeId()); } \
explicit WSF_MESSAGE_TYPE(UCI_Interface& aInterface) : UCI_MessageType(aInterface) { SetType(GetTypeId()); } \
WSF_MESSAGE_TYPE(UCI_Interface& aInterface, const uci::type::UCI_MESSAGE_TYPE& aType) : UCI_MessageType(aInterface, aType) { SetType(GetTypeId()); } \
WSF_MESSAGE_TYPE(const WSF_MESSAGE_TYPE& aSrc) = default; \
~WSF_MESSAGE_TYPE() override = default; \
WsfMessage* Clone() const override { return new WSF_MESSAGE_TYPE(*this); } \
static std::unique_ptr<WSF_MESSAGE_TYPE##Service> CreateMessageService(UCI_Interface& aInterface, \
uci::base::AbstractServiceBusConnection* aAsbPtr, \
const char* aTopic) \
{ return ut::make_unique<WSF_MESSAGE_TYPE##Service>(aInterface, aAsbPtr, aTopic); } \
const char* GetScriptClassName() const override { return #WSF_MESSAGE_TYPE; } \
static WsfStringId GetTypeId() { return #WSF_TYPE_NAME; } \
static WsfStringId GetUCI_TypeName() { return #UCI_MESSAGE_TYPE; } \
};
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115

Define a WSF message type with the contents of an existing UCI message type. The WSF type can be constructed and destructed without direct reference to the abstract bus. Arguments: WSF_MESSAGE_TYPE : The name of the WSF message type. UCI_MESSAGE_TYPE : The name of the existing UCI message type. WSF_TYPE_NAME : The name of the message as referenced in on_message blocks in WSF. UCI_ACCESSOR_NAME : The accessor id corresponding with the existing UCI message type (from uci::type::accessorType).

For example, the following definition:

DEFINE_UCI_MESSAGE_TYPE(UCI_ControlRequestMessage, ControlRequest, UCI_CONTROL_REQUEST_MESSAGE, controlRequestMT);
#define DEFINE_UCI_MESSAGE_TYPE(WSF_MESSAGE_TYPE, UCI_MESSAGE_TYPE, WSF_TYPE_NAME, UCI_ACCESSOR_NAME)
Definition WsfUCI_Messages.hpp:283

produces the following code expansion:

class UCI_ControlRequestMessage : public UCI_MessageType<uci::type::ControlRequest,
uci::factory::ControlRequestFactory,
uci::reader::ControlRequestReader,
uci::writer::ControlRequestWriter,
uci::reader::ControlRequestListener,
uci::type::accessorType::controlRequestMT>
{
public:
explicit UCI_ControlRequestMessage(WsfPlatform* aPlatform) : UCI_MessageType(aPlatformPtr) {}
explicit UCI_ControlRequestMessage(UCI_Interface& aInterface) : UCI_MessageType(aInterface) {}
UCI_ControlRequestMessage(const UCI_ControlRequestMessage& aSrc) = default;
UCI_ControlRequestMessage(UCI_Interface& aInterface, const uci::type::UCI_ControlRequestMessage& aType) : UCI_MessageType(aInterface, aType) {}
~UCI_ControlRequestMessage() override = default;
WsfMessage* Clone() const override { return new UCI_ControlRequestMessage(*this); }
const char* GetScriptClassName() const override { return "UCI_ControlRequestMessage"; }
static WsfStringId GetTypeId() { static WsfStringId sMessageTypeId("UCI_CONTROL_REQUEST_MESSAGE"); return sMessageTypeId; }
};
Copyrights Multiple, All Rights Reserved