Conscience Core
Public Member Functions | Static Public Member Functions | List of all members
conscience_core::core_objects::entities::CscRealEntityMessageHandler Class Reference

#include <CscRealEntityMessageHandler.h>

Inheritance diagram for conscience_core::core_objects::entities::CscRealEntityMessageHandler:
conscience_core::communication::CscMessageHandler

Public Member Functions

 CscRealEntityMessageHandler (bool ignoreNewEntity, CscEnvironmentSimulator &environmentSimulator)
 
 ~CscRealEntityMessageHandler ()
 
optional< CscMessageHandlerResulthandleMessage (const string &messageSubject, const vector< string > &args, optional< int > knowledgeId, ptr< CscMessagingRequestContext > context) override
 
optional< string > handleLowLevelMessage (const string &message) override
 
- Public Member Functions inherited from conscience_core::communication::CscMessageHandler
 CscMessageHandler ()
 
virtual ~CscMessageHandler ()
 

Static Public Member Functions

static bool handleFullStatus (const vector< string > *commandArguments)
 
static bool handleCurrentLidar (const vector< string > &commandArguments)
 
static void sendPositionToEntity (const CscPoint3dOriented *position, const string &serialNumber)
 
static void sendPositionToEntity (const CscPoint3dOriented *position, const ptr< CscEntityReflexion > &entityReflexion)
 
static void sendLiveTargetForSlaveUpdate (const CscPoint3dOriented *position, const string serialNumber, float distance, float altitudeToFollow)
 
static void sendSequenceStop (const string &serialNumber)
 
static EntityReflexionWithOptions handleMyProfile (const vector< string > &commandArguments, CscEnvironmentSimulator &env, string remoteIp, int remontePort, bool ignoreNewEntity=false)
 Handles the "MY_PROFILE" command for an entity. More...
 

Constructor & Destructor Documentation

◆ CscRealEntityMessageHandler()

conscience_core::core_objects::entities::CscRealEntityMessageHandler::CscRealEntityMessageHandler ( bool  ignoreNewEntity,
CscEnvironmentSimulator environmentSimulator 
)
Parameters
environmentSimulatorThe simulator environment in which to operate.
ignoreNewEntityIf true, during handleMyProfile(), the handler do not attempt to create a new entity if it does not already exist (default: false).

◆ ~CscRealEntityMessageHandler()

conscience_core::core_objects::entities::CscRealEntityMessageHandler::~CscRealEntityMessageHandler ( )

Member Function Documentation

◆ handleCurrentLidar()

bool conscience_core::core_objects::entities::CscRealEntityMessageHandler::handleCurrentLidar ( const vector< string > &  commandArguments)
static

◆ handleFullStatus()

bool conscience_core::core_objects::entities::CscRealEntityMessageHandler::handleFullStatus ( const vector< string > *  commandArguments)
static

◆ handleLowLevelMessage()

optional< string > conscience_core::core_objects::entities::CscRealEntityMessageHandler::handleLowLevelMessage ( const string &  message)
overridevirtual

Handle a low level message. Low level means it is interpreted early in the message processing cycle. Typically it will be processed before encryption, placeholders interpolation or chunks reconstitution. It's useful to answer a simple, non sensitive, unencrypted message, for instance before communication is being secured.

Returns
a string if message has been handled (can be empty string). Return empty optional to declare message as not handled.

Implements conscience_core::communication::CscMessageHandler.

◆ handleMessage()

optional< CscMessageHandlerResult > conscience_core::core_objects::entities::CscRealEntityMessageHandler::handleMessage ( const string &  messageSubject,
const vector< string > &  args,
optional< int >  knowledgeId,
ptr< CscMessagingRequestContext context 
)
overridevirtual

Implement this method to handle Conscience messages received by the CscMessagingManager.

Parameters
messageSubjectaction / verb for this message, it is typically something like: GET_SCENE_OBJECTS
argsmessage's arguments
knowledgeIdmessage can optionally take a knowledgeId argument, which is a contextual information
contextinformation about the context of the message, contains the originator, and allows to respond
Note
MessageHandler implementation can just delegate most of the messages to Conscience Command API (please see processKnowledgeItemCommand)
See also
CscMessagingManager::sendBack(const string &response, ptr<CscMessagingRequestContext>)

Implements conscience_core::communication::CscMessageHandler.

◆ handleMyProfile()

EntityReflexionWithOptions conscience_core::core_objects::entities::CscRealEntityMessageHandler::handleMyProfile ( const vector< string > &  commandArguments,
CscEnvironmentSimulator env,
string  remoteIp,
int  remontePort,
bool  ignoreNewEntity = false 
)
static

Handles the "MY_PROFILE" command for an entity.

Parameters
commandArgumentscontent of MY_ROFILE command.
envThe simulator environment in which to operate.
remoteIpThe remote IP address of entity.
remontePortThe remote port number for communication with entity.
ignoreNewEntityIf true, do not attempt to create a new entity if it does not already exist (default: false).

◆ sendLiveTargetForSlaveUpdate()

void conscience_core::core_objects::entities::CscRealEntityMessageHandler::sendLiveTargetForSlaveUpdate ( const CscPoint3dOriented position,
const string  serialNumber,
float  distance,
float  altitudeToFollow 
)
static

◆ sendPositionToEntity() [1/2]

void conscience_core::core_objects::entities::CscRealEntityMessageHandler::sendPositionToEntity ( const CscPoint3dOriented position,
const ptr< CscEntityReflexion > &  entityReflexion 
)
static

◆ sendPositionToEntity() [2/2]

void conscience_core::core_objects::entities::CscRealEntityMessageHandler::sendPositionToEntity ( const CscPoint3dOriented position,
const string &  serialNumber 
)
static

◆ sendSequenceStop()

void conscience_core::core_objects::entities::CscRealEntityMessageHandler::sendSequenceStop ( const string &  serialNumber)
static

The documentation for this class was generated from the following files: