rad
5.1.0
|
Namespaces | |
cii | |
core | |
detail | |
itest | |
services | |
utest | |
utils | |
Typedefs | |
using | SharedEvent = std::shared_ptr< const AnyEvent > |
using | UniqueEvent = std::unique_ptr< AnyEvent > |
typedef std::list< scxml4cpp::Action * > | ActionList |
typedef std::list< rad::ActionGroup * > | ActionGroupList |
typedef std::list< scxml4cpp::Activity * > | ActivityList |
using | TrsHealthBadEvent = rad::EventT< TrsHealthBadEventTrait > |
using | TrsHealthGoodEvent = rad::EventT< TrsHealthGoodEventTrait > |
Enumerations | |
enum class | ErrorCodes { CANCELLED = 0 , REPLY_TIMEOUT , DESERIALIZATION_ERR , UNKNOWN } |
enum | LogLevel { LOG_LEVEL_UNKNOWN = -1 , LOG_LEVEL_ERROR = 0 , LOG_LEVEL_WARNING , LOG_LEVEL_STATE , LOG_LEVEL_EVENT , LOG_LEVEL_GUARD , LOG_LEVEL_ACTION , LOG_LEVEL_INFO , LOG_LEVEL_DEBUG , LOG_LEVEL_DEBUG1 , LOG_LEVEL_DEBUG2 , LOG_LEVEL_DEBUG3 , LOG_LEVEL_DEBUG4 , LOG_LEVEL_TRACE } |
Functions | |
void | GetListOfKeysFromConfig (const elt::configng::CiiConfigInstanceNode &node, const std::string &prefix, std::vector< std::string > &keys) |
std::vector< std::string > | GetListOfKeysFromConfig (const elt::configng::CiiConfigDocument &cfg_doc) |
void | GetListOfKeysFromConfig (const elt::configng::CiiConfigInstanceNode &node, std::vector< std::string > &keys) |
void | Assert (bool condition, const char *filename, const char *functionname, int linenumber) |
std::ostream & | operator<< (std::ostream &os, const rad::Exception &e) |
const ErrorCategory & | GetErrorCategory () |
std::error_code | make_error_code (rad::ErrorCodes e) |
std::map< std::string, std::string > | GetDefaultLogProperties (const std::string &logsink_filename, const std::string &log_level="ERROR") |
log4cplus::Logger & | GetLogger () |
log4cplus::Logger & | GetSmLogger () |
log4cplus::Logger & | GetAppLogger () |
log4cplus::Logger & | GetRootLogger () |
void | LogInitialize () |
void | LogConfigure (const std::string &filename="") |
void | LogTraceFunction (const LogLevel level, const char *filename, const char *funcname, const int linenum) |
void | LogFunction (const LogLevel level, const char *funcname, const std::string &a) |
void | LogStateFunction (const std::string &a, const std::string &b) |
void | LogEventFunction (const std::string &a) |
template<typename EVENT > | |
EVENT::payload_t & | GetPayload (AnyEvent &ev) |
template<typename EVENT > | |
EVENT::payload_t const & | GetPayload (AnyEvent const &ev) |
template<typename EVENT > | |
EVENT::payload_t * | GetPayloadNothrow (AnyEvent &ev) |
template<typename EVENT > | |
EVENT::payload_t const * | GetPayloadNothrow (AnyEvent const &ev) |
template<typename EventType > | |
EventType | ParseRequestAndCreateEvent (const std::string &identity, const std::string &request_name, const void *msg, size_t msg_size) |
template<typename EventType > | |
EventType | ParseTopicAndCreateEvent (const std::string &topic_name, const void *msg, size_t msg_size) |
template<class T , class... Args> | |
std::shared_ptr< T > | MakeSharedFromTuple (std::tuple< Args... > &args) |
template<typename T > | |
void | DefaultRequestRejectHandler (const rad::AnyEvent &event, const std::string &state) |
template<typename EventType > | |
std::function< void(const std::string &, const std::string &, const void *, size_t)> | ReqProcessEvent (SMAdapter &sm) |
template<typename EventType > | |
std::function< void(const std::string &, const void *, size_t)> | TopicProcessEvent (SMAdapter &sm) |
template<typename EVENT > | |
const EVENT & | GetLastEvent (scxml4cpp::Context *c) |
const rad::AnyEvent & | GetLastAnyEvent (scxml4cpp::Context *c) |
template<typename EVENT > | |
EVENT::payload_t & | GetLastEventPayload (scxml4cpp::Context *c) |
template<typename EVENT > | |
EVENT::payload_t const * | GetLastEventPayloadNothrow (scxml4cpp::Context *c) |
Variables | |
const char | CONFIG_KEY_SEPARATOR_OLDB = '/' |
const std::string | KEY_CONFIG = "cfg/" |
const std::string | KEY_CONFIG_VERSION = KEY_CONFIG + "version" |
const std::string | KEY_CONFIG_MODNAME = KEY_CONFIG + "modname" |
const std::string | KEY_CONFIG_PROCNAME = KEY_CONFIG + "procname" |
const std::string | KEY_CONFIG_FILENAME = KEY_CONFIG + "filename" |
const std::string | KEY_CONFIG_LOG_LEVEL = KEY_CONFIG + "log_level" |
const std::string | KEY_CONFIG_LOG_PROPERTIES = KEY_CONFIG + "log_properties" |
const std::string | KEY_CONFIG_SM_SCXML = KEY_CONFIG + "sm_scxml" |
const std::string | KEY_CONFIG_SM_APPEND = KEY_CONFIG + "sm_scxml_append" |
const std::string | KEY_CONFIG_REQ_ENDPOINT = KEY_CONFIG + "req_endpoint" |
const std::string | KEY_CONFIG_OLDB_URI_PREFIX = KEY_CONFIG + "oldb_uri_prefix" |
const std::string | KEY_CONFIG_OLDB_CONN_TIMEOUT = KEY_CONFIG + "oldb_conn_timeout" |
const std::string | KEY_CONFIG_TRS_HEALTH_ENABLED = KEY_CONFIG + "trs_health_enabled" |
const std::vector< std::string > | KEYS_CONFIG |
const std::string | KEY_MON_STATE = "mon/state" |
const std::string | KEY_MON_TRS_HEALTH = "mon/trs/health" |
const std::string | KEY_MON_TRS_REASON = "mon/trs/reason" |
const std::string | LOGGER_NAME = "rad" |
const std::string | SM_LOGGER_NAME = "rad.sm" |
const std::string | APP_LOGGER_NAME = "app" |
const int | LOG_MAX_LEVEL = LOG_LEVEL_TRACE |
const int | LOG_MAX_LEN = 2048 |
const int | LOG_TIMESTAMP_MAXLEN = 100 |
typedef std::list<rad::ActionGroup*> rad::ActionGroupList |
typedef std::list<scxml4cpp::Action*> rad::ActionList |
typedef std::list<scxml4cpp::Activity*> rad::ActivityList |
using rad::SharedEvent = typedef std::shared_ptr<const AnyEvent> |
using rad::TrsHealthBadEvent = typedef rad::EventT<TrsHealthBadEventTrait> |
using rad::TrsHealthGoodEvent = typedef rad::EventT<TrsHealthGoodEventTrait> |
using rad::UniqueEvent = typedef std::unique_ptr<AnyEvent> |
|
strong |
enum rad::LogLevel |
void rad::Assert | ( | bool | condition, |
const char * | filename, | ||
const char * | functionname, | ||
int | linenumber | ||
) |
This function logs a failed assertion when the condition parameter is false.
[in] | condition | Condition to verify. |
[in] | filename | Assertion's filename. |
[in] | functionname | Assetions's function name. |
[in] | linenumber | Assetions's line. |
void rad::DefaultRequestRejectHandler | ( | const rad::AnyEvent & | event, |
const std::string & | state | ||
) |
This function can be used to send a "reject" reply to the originator of a request that cannot be handled in the current state.
event | Event related to the incoming request. |
state | Current state retrieved from the SM engine. |
log4cplus::Logger & rad::GetAppLogger | ( | ) |
std::map< std::string, std::string > rad::GetDefaultLogProperties | ( | const std::string & | logsink_filename, |
const std::string & | log_level = "ERROR" |
||
) |
logsink_filename | Filename for the logsink appender. |
log_level | Log level for the root logger, default is "ERROR" (possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR"). |
|
inline |
const rad::AnyEvent & rad::GetLastAnyEvent | ( | scxml4cpp::Context * | c | ) |
const EVENT& rad::GetLastEvent | ( | scxml4cpp::Context * | c | ) |
EVENT::payload_t& rad::GetLastEventPayload | ( | scxml4cpp::Context * | c | ) |
EVENT::payload_t const* rad::GetLastEventPayloadNothrow | ( | scxml4cpp::Context * | c | ) |
std::vector< std::string > rad::GetListOfKeysFromConfig | ( | const elt::configng::CiiConfigDocument & | cfg_doc | ) |
Helper functions that retrieves the list of keys in a configuration document.
cfg_doc | Configuration doc. |
void rad::GetListOfKeysFromConfig | ( | const elt::configng::CiiConfigInstanceNode & | node, |
const std::string & | prefix, | ||
std::vector< std::string > & | keys | ||
) |
void rad::GetListOfKeysFromConfig | ( | const elt::configng::CiiConfigInstanceNode & | node, |
std::vector< std::string > & | keys | ||
) |
Helper functions that retrieves the list of keys in a configuration document.
node | Configuration instance node. |
keys | Returned list of keys in the given configuration document. |
log4cplus::Logger & rad::GetLogger | ( | ) |
EVENT::payload_t& rad::GetPayload | ( | AnyEvent & | ev | ) |
Access the payload in a type-safe manner.
IncorrectEventType | if EVENT does not match the contained event. |
Example:
auto ev = make_event<MyEvent>(new std::string("hello world")); auto& payload = ev.getPayload<MyEvent>();
EVENT::payload_t const& rad::GetPayload | ( | AnyEvent const & | ev | ) |
Const version of getPayload();
EVENT::payload_t* rad::GetPayloadNothrow | ( | AnyEvent & | ev | ) |
Access the payload in a type-safe manner.
Example:
auto ev = make_event<MyEvent>(new std::string("hello world")); auto payload = ev.GetPayload<MyEvent>();
EVENT::payload_t const* rad::GetPayloadNothrow | ( | AnyEvent const & | ev | ) |
Const version of GetPayloadNothrow()
log4cplus::Logger & rad::GetRootLogger | ( | ) |
log4cplus::Logger & rad::GetSmLogger | ( | ) |
void rad::LogConfigure | ( | const std::string & | filename = "" | ) |
|
inline |
|
inline |
void rad::LogInitialize | ( | ) |
|
inline |
|
inline |
|
inline |
Overload the global make_error_code() free function with our custom enum.
std::shared_ptr<T> rad::MakeSharedFromTuple | ( | std::tuple< Args... > & | args | ) |
std::ostream & rad::operator<< | ( | std::ostream & | os, |
const rad::Exception & | e | ||
) |
EventType rad::ParseRequestAndCreateEvent | ( | const std::string & | identity, |
const std::string & | request_name, | ||
const void * | msg, | ||
size_t | msg_size | ||
) |
Parses a request and create the corresponding event.
[in] | identity | Request identity. |
[in] | request_name | Request name. |
[in] | msg | Pointer to the payload. |
[in] | msg_size | Size of the payload. |
EventType rad::ParseTopicAndCreateEvent | ( | const std::string & | topic_name, |
const void * | msg, | ||
size_t | msg_size | ||
) |
Parses a topic and create the corresponding event.
[in] | topic_name | Topic name. |
[in] | msg | Pointer to the payload. |
[in] | msg_size | Size of the payload. |
std::function<void(const std::string&, const std::string&, const void*, size_t)> rad::ReqProcessEvent | ( | SMAdapter & | sm | ) |
Function that creates a request handler to forward events to the SM
std::function<void(const std::string&, const void*, size_t)> rad::TopicProcessEvent | ( | SMAdapter & | sm | ) |
Function that creates a topic handler to forward events to the SM
const std::string rad::APP_LOGGER_NAME = "app" |
const char rad::CONFIG_KEY_SEPARATOR_OLDB = '/' |
const std::string rad::KEY_CONFIG = "cfg/" |
Common application configuration parameters.
const std::string rad::KEY_CONFIG_FILENAME = KEY_CONFIG + "filename" |
const std::string rad::KEY_CONFIG_LOG_LEVEL = KEY_CONFIG + "log_level" |
const std::string rad::KEY_CONFIG_LOG_PROPERTIES = KEY_CONFIG + "log_properties" |
const std::string rad::KEY_CONFIG_MODNAME = KEY_CONFIG + "modname" |
const std::string rad::KEY_CONFIG_OLDB_CONN_TIMEOUT = KEY_CONFIG + "oldb_conn_timeout" |
const std::string rad::KEY_CONFIG_OLDB_URI_PREFIX = KEY_CONFIG + "oldb_uri_prefix" |
const std::string rad::KEY_CONFIG_PROCNAME = KEY_CONFIG + "procname" |
const std::string rad::KEY_CONFIG_REQ_ENDPOINT = KEY_CONFIG + "req_endpoint" |
const std::string rad::KEY_CONFIG_SM_APPEND = KEY_CONFIG + "sm_scxml_append" |
const std::string rad::KEY_CONFIG_SM_SCXML = KEY_CONFIG + "sm_scxml" |
const std::string rad::KEY_CONFIG_TRS_HEALTH_ENABLED = KEY_CONFIG + "trs_health_enabled" |
const std::string rad::KEY_CONFIG_VERSION = KEY_CONFIG + "version" |
const std::string rad::KEY_MON_STATE = "mon/state" |
const std::string rad::KEY_MON_TRS_HEALTH = "mon/trs/health" |
const std::string rad::KEY_MON_TRS_REASON = "mon/trs/reason" |
const std::vector<std::string> rad::KEYS_CONFIG |
const int rad::LOG_MAX_LEN = 2048 |
const int rad::LOG_MAX_LEVEL = LOG_LEVEL_TRACE |
const int rad::LOG_TIMESTAMP_MAXLEN = 100 |
const std::string rad::LOGGER_NAME = "rad" |
const std::string rad::SM_LOGGER_NAME = "rad.sm" |