mcx::user_parameters::Module

mcx::user_parameters::Module

Inherits from mcx::container::Module

Public Functions

Name
Module(const std::string & filename)
Module() =default
virtual ~Module() override =default
Default destructor.
Status load(const std::string & file)
Status getStatus() const

Additional inherited members

Public Types inherited from mcx::container::Module

Name
enum class ModuleStates { NOT_INITIALIZED, PHASE_0, PHASE0, PHASE0_1, PHASE1, PHASE1_2, PHASE2, PHASE2_OP, OP, OP_PHASE2, PHASE2_NOT_INIT}
enum class ModuleErrors { NO_ERROR, NO_CALLBACK_DEFINED, CALLBACK_FAILED, WRONG_STATE}
enum class ModuleEvents { EMPTY, STOP, START, PAUSE, ACK}

Public Functions inherited from mcx::container::Module

Name
Module & operator=(const Module & ) =delete
Copy constructors are deleted.
void create(const char * name, parameter_server::Parameter * parameter_server, uint64_t dt_micro_s =0)
Executes ‘Create’ phase of initialization.
void create(const char * name, parameter_server::Parameter * parameter_server, uint64_t dt_micro_s, parameter_server::UserGroup owner_group, uint32_t permissions =parameter_server::default_permissions)
Extended interface with access permissions.
bool initPhase1()
Executes initialization of the parameter tree phase.
bool initPhase2()
Initialization, which require parameter tree to be complete and loaded.
bool startOp()
Final initialization before entering Operation mode.
bool stopOp()
Stops Operation mode, switches back to PHASE2.
bool iterate(const TaskTime & task_time, UserTime * user_time)
Iterates an execution cycle of the module.
void setName(const char * name)
Sets the name of the module.
const char * getName() const
Returns the name of the module.
void setDtMicroSec(uint64_t micro_sec)
Sets a cycle time of module and its submodules in microseconds.
uint64_t getDtMicroSec() const
Returns a cycle time as an integer in microseconds.
void setDtSec(double sec)
Sets a cycle time of module and its submodules in seconds.
double getDtSec() const
ModuleStates getState() const
Returns an actual state.
void setEvent(ModuleEvents event)
Command an event.
ModuleErrors getError() const
Returns active error code.

Protected Functions inherited from mcx::container::Module

Name
virtual bool iteratePreOp_(const TaskTime & system_time, UserTime * user_time)
User-defined callback which is called during Phase 2.
void createSubmodule(Module * module, const char * name)
Creates and registers submodule.
template <typename T >
void
createSubmodules(utils::span< T > module_array, const char * basename)
Creates and registers an array of submodules.
void setType(const char * name)
Sets a type of the module.
template <size_t buffer_size =parameter_server::DEFAULT_INPUT_BUFFER_LENGTH>
parameter_server::ParamHandle
addParameter(const char * id, parameter_server::ParameterType param_type, char * str_ptr, size_t length)
Helper function to register C-string member variable in the parameter tree.
template <typename T ,size_t buffer_size =parameter_server::DEFAULT_INPUT_BUFFER_LENGTH,add_visitable::EnableIfNotVisitable< T > =true>
parameter_server::ParamHandle
addParameter(const char * id, parameter_server::ParameterType param_type, T * value_ptr, size_t length =1, parameter_server::Unit param_unit =parameter_server::Unit::undefined)
Helper function to register member variable of in the parameter tree.
template <typename T ,size_t buffer_size =parameter_server::DEFAULT_INPUT_BUFFER_LENGTH,add_visitable::EnableIfVisitable< T > =true>
parameter_server::GroupHandle
addParameter(const char * id, parameter_server::ParameterType param_type, T * value_ptr, size_t length =1, parameter_server::Unit param_unit =parameter_server::Unit::undefined)
Helper function to register visitable PODs in the parameter tree.
template <typename T ,size_t buffer_size =parameter_server::DEFAULT_INPUT_BUFFER_LENGTH>
parameter_server::ParamHandle
addParameter(const char * id, parameter_server::ParameterType param_type, parameter_server::DataType data_type, T * value_ptr, size_t length =1, parameter_server::Unit param_unit =parameter_server::Unit::undefined)
Helper function to register types, which cannot be deduced.
parameter_server::SubHandle subscribe(const char * path)
Helper function to subscribe for the parameter’s update.
parameter_server::ReqHandle request(const char * path)
Helper function to request a parameter’s value.
parameter_server::PubHandle publish(const char * path)
Helper function to update parameter’s value.
parameter_server::Parameter * getParameterRoot()
Returns the root of the parameter tree.
parameter_server::Parameter * getLocalBranch()
Returns the root of the local branch.

Friends inherited from mcx::container::Module

Name
class Task

Public Functions Documentation

function Module

explicit Module(
    const std::string & filename
)

function Module

Module() =default

function ~Module

virtual ~Module() override =default

Default destructor.

Reimplements: mcx::container::Module::~Module

function load

Status load(
    const std::string & file
)

function getStatus

Status getStatus() const

Updated on 2022-04-05 at 16:21:27 +0200