RTC Toolkit  0.1.0-alpha
Namespaces | Classes | Typedefs | Functions | Variables
rtctk::componentFramework Namespace Reference

Namespaces

 detail
 

Classes

class  CommandHandler
 
class  CommandHandlerImpl
 
class  CommandReplier
 
class  CommandRequestor
 
class  DataPointPath
 
class  DirCreationError
 
class  FakeOldbAdapter
 A file based OLDB adapter that simulates OLDB with a local YAML file. More...
 
class  FakeRuntimeRepoAdapter
 
class  FileFormatError
 
class  FileRepository
 
class  InvalidArgumentException
 
class  InvalidUriInFileError
 
class  LogInitializer
 
class  MatrixBuffer
 
class  OldbAdapter
 
class  OldbApiIf
 
class  PathMissingException
 
class  RepositoryIf
 Abstract interface providing basic read and write facilities to a repository. More...
 
class  RtcComponent
 
class  RunnableStateMachine
 
class  RunnableStateMachineLogic
 
class  RunnableStateMachineLogicIf
 
class  RuntimeRepoAdapter
 
class  RuntimeRepoApiIf
 
class  ServiceContainer
 
class  ServiceDiscovery
 
class  StateMachineEngine
 
class  StateMachineEventIf
 
class  StatePublisher
 
class  StateSubscriber
 
class  Subscription
 
class  ThreadActivity
 

Typedefs

using Args = detail::Args
 
using ActionMethod = std::function< void(scxml4cpp::Context *c)>
 
using GuardMethod = std::function< bool(scxml4cpp::Context *c)>
 
using ActivityMethod = std::function< void(StopToken f)>
 
using SuccessMethod = std::function< void()>
 
using FailureMethod = std::function< void(const std::runtime_error &)>
 
using RejectMethod = std::function< void(const rad::AnyEvent &, const std::string &state)>
 
using StateMethod = std::function< void(const std::string &)>
 
using StopSource = rad::StopSource
 
using StopToken = rad::StopToken
 
using Payload = std::string
 

Functions

template<class BusinessLogic , class BusinessLogicFactory >
void RunAsRtcComponent (Args const &args, BusinessLogicFactory factory)
 
template<class BusinessLogic >
void RunAsRtcComponent (Args const &args)
 
std::istream & operator>> (std::istream &input, DataPointPath &path)
 
std::string GetCfitsioErrorMsg (int status)
 
std::string CfitsioImageTypeToString (int bitpix)
 
std::string CfitsioDataTypeToString (int datatype)
 
template<typename T , typename A >
void WriteMatrixToFits (const std::string &filename, const MatrixBuffer< T, A > &matrix)
 
template<typename T , typename A >
void ReadMatrixFromFits (const std::string &filename, MatrixBuffer< T, A > &matrix)
 
template<typename T , typename A >
void WriteVectorToFits (const std::string &filename, const std::vector< T, A > &vector)
 
template<typename T , typename A >
void ReadVectorFromFits (const std::string &filename, std::vector< T, A > &vector)
 
template<typename A >
void WriteMatrixToFits (const std::string &filename, const MatrixBuffer< bool, A > &matrix)
 
template<typename A >
void ReadMatrixFromFits (const std::string &filename, MatrixBuffer< bool, A > &matrix)
 
template<typename A >
void WriteVectorToFits (const std::string &filename, const std::vector< bool, A > &vector)
 
template<typename A >
void ReadVectorFromFits (const std::string &filename, std::vector< bool, A > &vector)
 
DataPointPath operator""_dppath (const char *str, std::size_t len)
 
bool operator== (const DataPointPath &lhs, const char *rhs) noexcept
 
bool operator== (const DataPointPath &lhs, const std::string &rhs) noexcept
 
bool operator== (const DataPointPath &lhs, const DataPointPath &rhs) noexcept
 
DataPointPath operator+ (DataPointPath lhs, const DataPointPath &rhs)
 
DataPointPath operator/ (DataPointPath lhs, const DataPointPath &rhs)
 
std::ostream & operator<< (std::ostream &out, const DataPointPath &rhs)
 
template<typename T , typename A >
constexpr bool operator== (const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
 
template<typename T , typename A >
constexpr bool operator!= (const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
 
template<typename T , typename A >
constexpr bool operator< (const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
 
template<typename T , typename A >
constexpr bool operator<= (const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
 
template<typename T , typename A >
constexpr bool operator> (const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
 
template<typename T , typename A >
constexpr bool operator>= (const MatrixBuffer< T, A > &lhs, const MatrixBuffer< T, A > &rhs) noexcept
 
void LogConfigure (const std::string &cfg_file_name="")
 
void MakeLogger (const std::string &name, log4cplus::LogLevel ll, bool log_to_file=true, bool additive=false)
 
void SetDefaultLogger (const std::string &name)
 
log4cplus::Logger & GetLogger (const std::string &name="")
 
void ConfigureLogger (log4cplus::Logger &logger, log4cplus::LogLevel ll, bool log_to_file, bool additive)
 
void LogConfigure (const string &cfg_file_name)
 
log4cplus::Logger & GetLogger (const string &logger_name)
 
void MakeLogger (const string &name, log4cplus::LogLevel ll, bool log_to_file, bool additive)
 
template<typename EVENT >
std::shared_ptr< typename EVENT::payload_t > GetPayloadNothrow (scxml4cpp::Context *c)
 
std::string getScxmlFilePathName ()
 

Variables

const std::string DEFAULT_PATTERN = "[%D{%H:%M:%S:%q}][%-5p][%c] %m%n"
 
std::string default_logger = "root"
 

Typedef Documentation

◆ ActionMethod

using rtctk::componentFramework::ActionMethod = typedef std::function<void(scxml4cpp::Context* c)>

◆ ActivityMethod

using rtctk::componentFramework::ActivityMethod = typedef std::function<void(StopToken f)>

◆ Args

◆ FailureMethod

using rtctk::componentFramework::FailureMethod = typedef std::function<void(const std::runtime_error&)>

◆ GuardMethod

using rtctk::componentFramework::GuardMethod = typedef std::function<bool(scxml4cpp::Context* c)>

◆ Payload

using rtctk::componentFramework::Payload = typedef std::string

◆ RejectMethod

using rtctk::componentFramework::RejectMethod = typedef std::function<void(const rad::AnyEvent&, const std::string& state)>

◆ StateMethod

using rtctk::componentFramework::StateMethod = typedef std::function<void(const std::string&)>

◆ StopSource

using rtctk::componentFramework::StopSource = typedef rad::StopSource

◆ StopToken

using rtctk::componentFramework::StopToken = typedef rad::StopToken

◆ SuccessMethod

using rtctk::componentFramework::SuccessMethod = typedef std::function<void()>

Function Documentation

◆ CfitsioDataTypeToString()

std::string rtctk::componentFramework::CfitsioDataTypeToString ( int  datatype)

Returns a string representation of a Cfitsio data type code.

Parameters
[in]datatypeThe Cfitsio data type code that may be used with fits_read_pix or fits_write_pix.
Returns
Cfitsio data type as a string or "Unknown type" if the type code is not recognised.

◆ CfitsioImageTypeToString()

std::string rtctk::componentFramework::CfitsioImageTypeToString ( int  bitpix)

Returns a string representation of a Cfitsio image type code.

Parameters
[in]bitpixThe Cfitsio image type code that may be used with fits_create_img or returned by fits_get_img_equivtype.
Returns
Cfitsio image type as a string or "Unknown type" if the type code is not recognised.

◆ ConfigureLogger()

void rtctk::componentFramework::ConfigureLogger ( log4cplus::Logger &  logger,
log4cplus::LogLevel  ll,
bool  log_to_file,
bool  additive 
)

DOR, use the warning suppression macros to supress warning about use of auto_ptr

DOR, use the warning suppression macros to supress warning about use of auto_ptr

◆ GetCfitsioErrorMsg()

std::string rtctk::componentFramework::GetCfitsioErrorMsg ( int  status)

Helper function to convert a Cfitsio status code to a human readable message.

Parameters
[in]statusThe status code set by a Cfitsio routine.
Returns
An error message corresponding to the Cfitsio status code.

◆ GetLogger() [1/2]

log4cplus::Logger& rtctk::componentFramework::GetLogger ( const std::string &  name = "")

Get handle to a specific logger (used with logging macros)

The default logger will be retrieved when calling GetLogger() without any further arguments

Parameters
nameoptional: name of the requested logger
Returns
handle to the requested logger

◆ GetLogger() [2/2]

log4cplus::Logger& rtctk::componentFramework::GetLogger ( const string &  logger_name)

◆ GetPayloadNothrow()

template<typename EVENT >
std::shared_ptr<typename EVENT::payload_t> rtctk::componentFramework::GetPayloadNothrow ( scxml4cpp::Context *  c)

◆ getScxmlFilePathName()

std::string rtctk::componentFramework::getScxmlFilePathName ( )

◆ LogConfigure() [1/2]

void rtctk::componentFramework::LogConfigure ( const std::string &  cfg_file_name = "")

Initial logging system configuration

If no log properties file is given, the system will be configured programmatically using the RTC Tk default settings.

Parameters
cfg_file_nameoptional pathname of log4cplus .properties file

◆ LogConfigure() [2/2]

void rtctk::componentFramework::LogConfigure ( const string &  cfg_file_name)

◆ MakeLogger() [1/2]

void rtctk::componentFramework::MakeLogger ( const std::string &  name,
log4cplus::LogLevel  ll,
bool  log_to_file = true,
bool  additive = false 
)

Retrieve new logger programmatically

Parameters
namename of the new logger
llinitial log level (can be changed later)
log_to_fileoptional: should a log-file be created in the logsink directory
additiveoptional: enable additivity for logger

◆ MakeLogger() [2/2]

void rtctk::componentFramework::MakeLogger ( const string &  name,
log4cplus::LogLevel  ll,
bool  log_to_file,
bool  additive 
)

◆ operator!=()

template<typename T , typename A >
constexpr bool rtctk::componentFramework::operator!= ( const MatrixBuffer< T, A > &  lhs,
const MatrixBuffer< T, A > &  rhs 
)
constexprnoexcept

Compares two MatrixBuffer objects and returns true if they do not have the same shape or the elements are different.

◆ operator""_dppath()

DataPointPath rtctk::componentFramework::operator""_dppath ( const char *  str,
std::size_t  len 
)
inline

◆ operator+()

DataPointPath rtctk::componentFramework::operator+ ( DataPointPath  lhs,
const DataPointPath rhs 
)
inline
Parameters
lhsleft hand side operand
rhsright hand side operand

◆ operator/()

DataPointPath rtctk::componentFramework::operator/ ( DataPointPath  lhs,
const DataPointPath rhs 
)
inline
Parameters
lhsleft hand side operand
rhsright hand side operand

◆ operator<()

template<typename T , typename A >
constexpr bool rtctk::componentFramework::operator< ( const MatrixBuffer< T, A > &  lhs,
const MatrixBuffer< T, A > &  rhs 
)
constexprnoexcept

Compares two MatrixBuffer objects and returns true for the following cases:

  • If the lhs matrix has fewer elements.
  • If the number of elements is the same for lhs and rhs, but lhs has fewer rows.
  • If the shape of the matrices is the same and operator< returns true for the first element that is different between lhs and rhs. For any other case we return false.

◆ operator<<()

std::ostream& rtctk::componentFramework::operator<< ( std::ostream &  out,
const DataPointPath rhs 
)
inline

◆ operator<=()

template<typename T , typename A >
constexpr bool rtctk::componentFramework::operator<= ( const MatrixBuffer< T, A > &  lhs,
const MatrixBuffer< T, A > &  rhs 
)
constexprnoexcept

Compares two MatrixBuffer objects and effectively returns rhs < lhs or rhs == lhs.

◆ operator==() [1/4]

bool rtctk::componentFramework::operator== ( const DataPointPath lhs,
const char *  rhs 
)
inlinenoexcept

◆ operator==() [2/4]

bool rtctk::componentFramework::operator== ( const DataPointPath lhs,
const DataPointPath rhs 
)
inlinenoexcept

◆ operator==() [3/4]

bool rtctk::componentFramework::operator== ( const DataPointPath lhs,
const std::string &  rhs 
)
inlinenoexcept

◆ operator==() [4/4]

template<typename T , typename A >
constexpr bool rtctk::componentFramework::operator== ( const MatrixBuffer< T, A > &  lhs,
const MatrixBuffer< T, A > &  rhs 
)
constexprnoexcept

Compares two MatrixBuffer objects and returns true if they have the same shape and identical elements.

◆ operator>()

template<typename T , typename A >
constexpr bool rtctk::componentFramework::operator> ( const MatrixBuffer< T, A > &  lhs,
const MatrixBuffer< T, A > &  rhs 
)
constexprnoexcept

Compares two MatrixBuffer objects and returns true for the following cases:

  • If the lhs matrix has more elements.
  • If the number of elements is the same for lhs and rhs, but lhs has more rows.
  • If the shape of the matrices is the same and operator> returns true for the first element that is different between lhs and rhs. For any other case we return false.

◆ operator>=()

template<typename T , typename A >
constexpr bool rtctk::componentFramework::operator>= ( const MatrixBuffer< T, A > &  lhs,
const MatrixBuffer< T, A > &  rhs 
)
constexprnoexcept

Compares two MatrixBuffer objects and effectively returns rhs > lhs or rhs == lhs.

◆ operator>>()

std::istream& rtctk::componentFramework::operator>> ( std::istream &  input,
DataPointPath path 
)

Read into DataPointPath from istream

◆ ReadMatrixFromFits() [1/2]

template<typename A >
void rtctk::componentFramework::ReadMatrixFromFits ( const std::string &  filename,
MatrixBuffer< bool, A > &  matrix 
)

Reads a matrix of boolean values from a FITS image with 8 bits per pixel.

◆ ReadMatrixFromFits() [2/2]

template<typename T , typename A >
void rtctk::componentFramework::ReadMatrixFromFits ( const std::string &  filename,
MatrixBuffer< T, A > &  matrix 
)

Reads a FITS file image into a MatrixBuffer object representing a matrix.

Parameters
[in]filenameName of the FITS file to read from.
[out]matrixThe matrix data object that will be updated with the loaded data.

◆ ReadVectorFromFits() [1/2]

template<typename A >
void rtctk::componentFramework::ReadVectorFromFits ( const std::string &  filename,
std::vector< bool, A > &  vector 
)

Read a vector of boolean values from a FITS files containing a 1D image of 8 bit pixels.

◆ ReadVectorFromFits() [2/2]

template<typename T , typename A >
void rtctk::componentFramework::ReadVectorFromFits ( const std::string &  filename,
std::vector< T, A > &  vector 
)

Reads a FITS file containing a 1D image into a std::vector object.

Parameters
[in]filenameName of the FITS file to read from.
[out]vectorThe vector data object that will be updated with the loaded data.

◆ RunAsRtcComponent() [1/2]

template<class BusinessLogic >
void rtctk::componentFramework::RunAsRtcComponent ( Args const &  args)

RTC Component runner function, needed to run custom BusinessLogic as RTC Component

Template Parameters
BusinessLogicuser implementation of business logic class, derived from logic interface.
Parameters
argsopaque arguments class to be passed on to the RTC Component class.
Exceptions
variousexceptions, which are caught in main

◆ RunAsRtcComponent() [2/2]

template<class BusinessLogic , class BusinessLogicFactory >
void rtctk::componentFramework::RunAsRtcComponent ( Args const &  args,
BusinessLogicFactory  factory 
)

RTC Component runner function, needed to run custom BusinessLogic as RTC Component

This method allows the defintion of a custom business logic factory to cover cases where the Business Logic class is not constructible with default arguments only.

Template Parameters
BusinessLogic,userimplementation of business logic class, derived from logic interface.
Parameters
argsopaque arguments class to be passed on to the RTC Component class.
factoryfactory class that constructs and returns a BusinessLogic object.
Exceptions
variousexceptions, which are caught in main

◆ SetDefaultLogger()

void rtctk::componentFramework::SetDefaultLogger ( const std::string &  name)

Set the default logger

The default logger will be retrieved when calling GetLogger() without any further arguments

Parameters
namename of the default logger

◆ WriteMatrixToFits() [1/2]

template<typename A >
void rtctk::componentFramework::WriteMatrixToFits ( const std::string &  filename,
const MatrixBuffer< bool, A > &  matrix 
)

Writes a matrix of boolean values as a FITS image with 8 bits per pixel.

◆ WriteMatrixToFits() [2/2]

template<typename T , typename A >
void rtctk::componentFramework::WriteMatrixToFits ( const std::string &  filename,
const MatrixBuffer< T, A > &  matrix 
)

Writes MatrixBuffer data representing a matrix as an image to a FITS file.

Parameters
[in]filenameName of the FITS file to create. It will be overwritten if it exists.
[in]matrixThe matrix data to write.

◆ WriteVectorToFits() [1/2]

template<typename A >
void rtctk::componentFramework::WriteVectorToFits ( const std::string &  filename,
const std::vector< bool, A > &  vector 
)

Write a vector of boolean values to a FITS file as a 1D image of 8 bit pixels.

◆ WriteVectorToFits() [2/2]

template<typename T , typename A >
void rtctk::componentFramework::WriteVectorToFits ( const std::string &  filename,
const std::vector< T, A > &  vector 
)

Writes std::vector data as a 1D image to a FITS file.

Parameters
[in]filenameName of the FITS file to create. It will be overwritten if it exists.
[in]vectorThe vector data to write.

Variable Documentation

◆ default_logger

std::string rtctk::componentFramework::default_logger = "root"

◆ DEFAULT_PATTERN

const std::string rtctk::componentFramework::DEFAULT_PATTERN = "[%D{%H:%M:%S:%q}][%-5p][%c] %m%n"