rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
rad Namespace Reference

Namespaces

 cii
 
 core
 
 detail
 
 errorMsg
 
 services
 
 utils
 

Classes

class  ActionCallback
 
class  ActionGroup
 
class  ActionMgr
 
class  ThreadBaseActivity
 
class  ThreadActivity
 
struct  IncorrectEventType
 
struct  EventInfo
 
class  AnyEvent
 
class  EventT
 
class  CoroActivity
 
class  DbAdapter
 
class  DbAdapterRedis
 
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  PthreadActivity
 
class  Signal
 
class  SMAdapter
 
class  SMEvent
 
class  SMRequestor
 
class  SMRequestorRaw
 
class  Timer
 
class  TopicHandler
 
class  TopicPub
 
class  TopicSub
 
class  Utils
 

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

void Assert (bool condition, const char *filename, const char *functionname, int linenumber)
 
template<class T , class... Args>
std::shared_ptr< T > MakeSharedFromTuple (std::tuple< Args...> &args)
 
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 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)
 
void LogInitialize ()
 
void LogConfigure (const std::string &filename="")
 
log4cplus::Logger & GetLogger ()
 
log4cplus::Logger & GetSmLogger ()
 
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 &request_name, const void *msg, size_t msg_size)
 
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 &topic_name, const void *msg, size_t msg_size)
 

Variables

const std::string LOGGER_NAME = "rad"
 
const std::string SM_LOGGER_NAME = "rad.sm"
 
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 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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

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.

Parameters
[in]conditionCondition to verify.
[in]filenameAssertion's filename.
[in]functionnameAssetions's function name.
[in]linenumberAssetions's line.
const ErrorCategory & rad::GetErrorCategory ( )
inline
log4cplus::Logger & rad::GetLogger ( )
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::GetPayloadNothrow ( 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::GetPayloadNothrow ( AnyEvent const &  ev)

Const version of GetPayloadNothrow()

log4cplus::Logger & rad::GetSmLogger ( )
void rad::LogConfigure ( const std::string &  filename = "")
void rad::LogEventFunction ( const std::string &  a)
inline
void rad::LogFunction ( const LogLevel  level,
const char *  funcname,
const std::string &  a 
)
inline
void rad::LogInitialize ( )
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

Overload the global make_error_code() free function with our custom enum.

template<class T , class... Args>
std::shared_ptr< T > rad::MakeSharedFromTuple ( std::tuple< Args...> &  args)
template<typename EventType >
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.

Parameters
[in]identityRequest identity.
[in]request_nameRequest name.
[in]msgPointer to the payload.
[in]msg_sizeSize of the payload.
template<typename EventType >
EventType rad::ParseTopicAndCreateEvent ( const std::string &  topic_name,
const void *  msg,
size_t  msg_size 
)

Parses a topic and create the corresponding event.

Parameters
[in]topic_nameTopic name.
[in]msgPointer to the payload.
[in]msg_sizeSize 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
const std::string rad::LOGGER_NAME = "rad"
const std::string rad::SM_LOGGER_NAME = "rad.sm"