ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
rad Namespace Reference

Namespaces

 core
 
 ErrorMsg
 
 services
 
 utils
 

Classes

class  ActionCallback
 
class  ActionGroup
 
class  ActionMgr
 
class  Activity
 
class  ActivityPthread
 
struct  IncorrectEventType
 
struct  EventInfo
 
class  AnyEvent
 
class  EventT
 
class  DbAdapter
 
class  DbAdapterRedis
 
class  Dispatcher
 
class  ErrorCategory
 
class  Event
 
class  Event< EVENT, typename std::enable_if<!std::is_void< typename EVENT::payload_t >::value >::type >
 
class  Exception
 
class  RuntimeDbException
 
class  InvalidOptionException
 
class  GuardCallback
 
class  Helper
 
class  Logger
 
class  MsgHandler
 
class  MsgReplier
 
class  MsgRequest
 
class  MsgRequestor
 
struct  MsgRequestor2
 
class  MsgRequestorRaw
 
struct  MsgRequestorRaw2
 
class  Signal
 
class  SMAdapter
 
class  SMEvent
 
class  SMRequestor
 
class  SMRequestorRaw
 
class  Timer
 
class  TopicHandler
 
class  TopicPub
 
class  TopicSub
 

Typedefs

typedef std::list
< scxml4cpp::Action * > 
ActionList
 
typedef std::list
< rad::ActionGroup * > 
ActionGroupList
 
typedef std::list
< scxml4cpp::Activity * > 
ActivityList
 
using SharedEvent = std::shared_ptr< const AnyEvent >
 
using UniqueEvent = std::unique_ptr< AnyEvent >
 

Enumerations

enum  ErrorCodes {
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::UNKNOWN,
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::UNKNOWN,
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::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, 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,
  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
}
 
enum  ErrorCodes {
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::UNKNOWN,
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::UNKNOWN,
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::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, 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,
  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
}
 
enum  ErrorCodes {
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::UNKNOWN,
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::UNKNOWN,
  ErrorCodes::CANCELLED = 0, ErrorCodes::REPLY_TIMEOUT, ErrorCodes::DESERIALIZATION_ERR, ErrorCodes::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, 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,
  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

const ErrorCategoryGetErrorCategory ()
 
std::error_code make_error_code (rad::ErrorCodes e)
 
template<typename EVENT >
EVENT::payload_t & getPayload (AnyEvent &ev)
 
template<typename EVENT >
EVENT::payload_t constgetPayload (AnyEvent const &ev)
 
template<typename EVENT >
EVENT::payload_t * getPayload_nothrow (AnyEvent &ev)
 
template<typename EVENT >
EVENT::payload_t constgetPayload_nothrow (AnyEvent const &ev)
 
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 EventType >
EventType ParseRequestAndCreateEvent (const std::string &identity, const std::string &requestName, const void *pMsg, size_t msgSize)
 
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 EventType >
EventType ParseTopicAndCreateEvent (const std::string &topicName, const void *pMsg, size_t msgSize)
 

Variables

const int LOG_MAX_LEVEL = LOG_LEVEL_TRACE
 
const int LOG_MAX_LEN = 2048
 
const int LOG_TIMESTAMP_MAXLEN = 100
 

Typedef Documentation

typedef std::list< rad::ActionGroup * > rad::ActionGroupList
typedef std::list< scxml4cpp::Action * > rad::ActionList
typedef std::list< scxml4cpp::Activity * > rad::ActivityList
typedef std::shared_ptr< const AnyEvent > rad::SharedEvent
typedef std::unique_ptr< AnyEvent > rad::UniqueEvent

Enumeration Type Documentation

enum rad::ErrorCodes
strong
Enumerator
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
enum rad::ErrorCodes
strong
Enumerator
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
enum rad::ErrorCodes
strong
Enumerator
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
CANCELLED 
REPLY_TIMEOUT 
DESERIALIZATION_ERR 
UNKNOWN 
Enumerator
LOG_LEVEL_UNKNOWN 
LOG_LEVEL_ERROR 
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_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_LEVEL_ERROR 
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 
Enumerator
LOG_LEVEL_UNKNOWN 
LOG_LEVEL_ERROR 
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 
LOG_LEVEL_UNKNOWN 
LOG_LEVEL_ERROR 
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 
LOG_LEVEL_UNKNOWN 
LOG_LEVEL_ERROR 
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 

Function Documentation

const ErrorCategory & rad::GetErrorCategory ( )
inline
template<typename EVENT >
EVENT::payload_t & rad::getPayload ( AnyEvent &  ev)

Access the payload in a type-safe manner.

Returns
A reference to the payload if the EVENT matches the contained event.
Exceptions
IncorrectEventTypeif EVENT does not match the contained event.

Example:

auto ev = make_event<MyEvent>(new std::string("hello world"));
auto& payload = ev.getPayload<MyEvent>();
template<typename EVENT >
EVENT::payload_t const & rad::getPayload ( AnyEvent const ev)

Const version of getPayload();

template<typename EVENT >
EVENT::payload_t * rad::getPayload_nothrow ( AnyEvent &  ev)

Access the payload in a type-safe manner.

Returns
A pointer to the payload if the EVENT matches the contained event and nullptr otherwise.

Example:

auto ev = make_event<MyEvent>(new std::string("hello world"));
auto payload = ev.getPayload<MyEvent>();
template<typename EVENT >
EVENT::payload_t const * rad::getPayload_nothrow ( AnyEvent const ev)

Const version of getPayload_nothrow()

void rad::LogEventFunction ( const std::string &  a)
inline
void rad::LogFunction ( const LogLevel  level,
const char *  funcName,
const std::string &  a 
)
inline
void rad::LogStateFunction ( const std::string &  a,
const std::string &  b 
)
inline
void rad::LogTraceFunction ( const LogLevel  level,
const char *  fileName,
const char *  funcName,
const int  lineNum 
)
inline
std::error_code rad::make_error_code ( rad::ErrorCodes  e)
inline
template<typename EventType >
EventType rad::ParseRequestAndCreateEvent ( const std::string &  identity,
const std::string &  requestName,
const void *  pMsg,
size_t  msgSize 
)

Parses a request and create the corresponding event.

Parameters
[in]identityRequest identity.
[in]requestNameRequest name.
[in]pMsgPointer to the payload.
[in]msgSizeSize of the payload.
template<typename EventType >
EventType rad::ParseTopicAndCreateEvent ( const std::string &  topicName,
const void *  pMsg,
size_t  msgSize 
)

Parses a topic and create the corresponding event.

Parameters
[in]topicNameTopic name.
[in]pMsgPointer to the payload.
[in]msgSizeSize of the payload.
template<typename EventType >
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

template<typename EventType >
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

Variable Documentation

const int rad::LOG_MAX_LEN = 2048
const int rad::LOG_MAX_LEVEL = LOG_LEVEL_TRACE
const int rad::LOG_TIMESTAMP_MAXLEN = 100