Conscience Core
Public Member Functions | Public Attributes | List of all members
conscience_core::bridging::commands::CscCommandParseContext Struct Reference

#include <CommandParseContext.h>

Public Member Functions

 CscCommandParseContext (optional< int > knowledgeId, const vector< string > &arguments, const string &originalCommandString, const ConscienceEncoder &conscienceEncoder, CscEntityModelsRepository &entityModelRepository, CscEntityReflexions &entityReflexions)
 
 ~CscCommandParseContext ()
 
CscStateWithExtras getCurrentStateFromArguments (unsigned index=STATE_ARGUMENT_INDEX) const
 
CscEntityModelgetEntityModelFromArguments () const
 
const vector< string > & getParameters ()
 
string getParameter (int index)
 
ptr< CscEntityReflexiongetEntityReflexionFromParameter (int index=0)
 
ptr< CscEntityReflexiongetEntityReflexionFromParameterOrThrow (int index=0) noexcept(false)
 
map< string, string > extractAdditionalParams (int fromIndex=0)
 

Public Attributes

const optional< int > knowledgeId
 
const vector< string > & arguments
 
const string & originalCommandString
 
const ConscienceEncoderencoder
 
CscEntityModelsRepositoryentityModelRepository
 
CscEntityReflexionsentityReflexions
 

Constructor & Destructor Documentation

◆ CscCommandParseContext()

conscience_core::bridging::commands::CscCommandParseContext::CscCommandParseContext ( optional< int >  knowledgeId,
const vector< string > &  arguments,
const string &  originalCommandString,
const ConscienceEncoder conscienceEncoder,
CscEntityModelsRepository entityModelRepository,
CscEntityReflexions entityReflexions 
)

◆ ~CscCommandParseContext()

conscience_core::bridging::commands::CscCommandParseContext::~CscCommandParseContext ( )

Member Function Documentation

◆ extractAdditionalParams()

map< string, string > conscience_core::bridging::commands::CscCommandParseContext::extractAdditionalParams ( int  fromIndex = 0)

extract parameters of form "name=value" (keep them in the vector)

Parameters
fromIndexuse this to skip indices on which there cannot be additional params - index is inclusive

◆ getCurrentStateFromArguments()

CscStateWithExtras conscience_core::bridging::commands::CscCommandParseContext::getCurrentStateFromArguments ( unsigned  index = STATE_ARGUMENT_INDEX) const

Retrieves state from arguments (argument at STATE_ARGUMENT_INDEX)

◆ getEntityModelFromArguments()

CscEntityModel * conscience_core::bridging::commands::CscCommandParseContext::getEntityModelFromArguments ( ) const

◆ getEntityReflexionFromParameter()

ptr< CscEntityReflexion > conscience_core::bridging::commands::CscCommandParseContext::getEntityReflexionFromParameter ( int  index = 0)

Returns entity reflexion from serial number in parameters at given index OR nullptr if entity reflexion is not found

◆ getEntityReflexionFromParameterOrThrow()

ptr< CscEntityReflexion > conscience_core::bridging::commands::CscCommandParseContext::getEntityReflexionFromParameterOrThrow ( int  index = 0)
noexcept

Returns entity reflexion from serial number in parameters at given index OR throw an exception if not found

◆ getParameter()

string conscience_core::bridging::commands::CscCommandParseContext::getParameter ( int  index)

◆ getParameters()

const vector< string > & conscience_core::bridging::commands::CscCommandParseContext::getParameters ( )

A specific list of parameters for a specific Conscience Environment Interaction Command (Compared to arguments, it's a sublist of arguments, specific to the command). NOTE: caller is in charge of deleting the returned pointer

Member Data Documentation

◆ arguments

const vector<string>& conscience_core::bridging::commands::CscCommandParseContext::arguments

◆ encoder

const ConscienceEncoder& conscience_core::bridging::commands::CscCommandParseContext::encoder

◆ entityModelRepository

CscEntityModelsRepository& conscience_core::bridging::commands::CscCommandParseContext::entityModelRepository

◆ entityReflexions

CscEntityReflexions& conscience_core::bridging::commands::CscCommandParseContext::entityReflexions

◆ knowledgeId

const optional<int> conscience_core::bridging::commands::CscCommandParseContext::knowledgeId

◆ originalCommandString

const string& conscience_core::bridging::commands::CscCommandParseContext::originalCommandString

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