ifw-ccf  3.0.0-pre2
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ccf::common::PubBase Class Reference

Class for implementing CCF Data Publishers. More...

#include <pubBase.hpp>

Inheritance diagram for ccf::common::PubBase:
ccf::Base ccf::stdpub::PubDdt ccf::stdpub::PubFits ccf::stdpub::PubRtms

Public Member Functions

 PubBase (const std::string &proc_thread_name, const std::string &pub_thread_name)
 
 PubBase ()
 
virtual ~PubBase ()
 
void Initialise ()
 
bool GetInitialised () const
 
void Dismantle ()
 
void SetEnabled (const bool enabled)
 
bool GetEnabled () const
 
const std::string & GetProcThreadName () const
 
const std::string & GetPubId () const
 
const std::string & GetPubThreadName () const
 
void Publish (DataFrame &frame, const bool force)
 
PubType GetPublisherType () const
 
void Activate ()
 
virtual void ActivateUser ()
 
void Deactivate ()
 
virtual void DeactivateUser ()
 
void SetActivated (const bool activated)
 
bool GetActivated () const
 
virtual void CheckForDeactivationUser ()
 
PublisherStatusGetPubStatus ()
 
void EstimateExecution (double &duration, int64_t &nb_of_frames)
 
void GetPubStatus (PublisherStatus &pub_stat) const
 Make a snapshot of the current Publisher Status object. More...
 
virtual void InitialiseUser ()
 
virtual void DismantleUser ()
 
virtual void PublishUser (DataFrame &frame)
 
virtual void CreateObjectUser (const std::string &proc_thread_name, const std::string &pub_thread_name, PubBase **new_object)
 
virtual void EstimateExecutionUser (double &duration, int64_t &nb_of_frames)
 
void ResetDbStatus () const
 Update status for a given Publisher Thread in the OLDB. More...
 
void UpdateDbStatus () const
 
std::string ToString () const
 
- Public Member Functions inherited from ccf::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class. More...
 
log4cplus::Logger & Loggger ()
 Return reference to logger used in this context. More...
 

Static Public Member Functions

static const std::string & GenId (const std::string &proc_thread_name, const std::string &pub_thread_name)
 Generate an ID for the Publisher. More...
 
template<class TYPE >
static void AddPubFactoryObj (TYPE &pub_factory_obj)
 Static method to register a Data Publisher factory object in the internal registry. More...
 
static const std::map< std::string, std::shared_ptr< PubBase > > & GetPubFactoryObjs ()
 Generate vector with references to the Publisher Factory Objects registered. More...
 
static void CreatePubObj (const std::string &class_name, const std::string &proc_thread_name, const std::string &pub_thread_name, PubBase **new_object)
 
static void GetPubObj (const std::string &proc_thread_name, const std::string &pub_thread_name, PubBase **pub_obj, const bool initialise=true)
 
static void GetPubObjs (std::vector< PubBase * > &pub_objs)
 Get reference to all Data Publisher Objects registered. More...
 
static bool HasPubObj (const std::string &proc_thread_name, const std::string &pub_thread_name, PubBase **pub_obj)
 Check if a Publisher object is defined. More...
 
- Static Public Member Functions inherited from ccf::Base
static ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton). More...
 
static void SetLogLevel (const ccf::LogLevel log_level)
 Set the log level. More...
 
static ccf::LogLevel GetLogLevel ()
 Return the current CCF log level. More...
 

Protected Attributes

PubType m_publisher_type
 
bool m_initialised
 
bool m_setup_enabled
 
bool m_stat_active
 
- Protected Attributes inherited from ccf::Base
log4cplus::Logger m_logger
 

Additional Inherited Members

- Protected Member Functions inherited from ccf::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question. More...
 
void SetLogger (log4cplus::Logger &logger)
 Set reference to logger used in this context. More...
 

Detailed Description

Class for implementing CCF Data Publishers.

Constructor & Destructor Documentation

◆ PubBase() [1/2]

ccf::common::PubBase::PubBase ( const std::string &  proc_thread_name,
const std::string &  pub_thread_name 
)

◆ PubBase() [2/2]

ccf::common::PubBase::PubBase ( )

◆ ~PubBase()

ccf::common::PubBase::~PubBase ( )
virtual

Member Function Documentation

◆ Activate()

void ccf::common::PubBase::Activate ( )

◆ ActivateUser()

void ccf::common::PubBase::ActivateUser ( )
virtual

Reimplemented in ccf::stdpub::PubFits.

◆ AddPubFactoryObj()

template<class TYPE >
static void ccf::common::PubBase::AddPubFactoryObj ( TYPE &  pub_factory_obj)
inlinestatic

Static method to register a Data Publisher factory object in the internal registry.

◆ CheckForDeactivationUser()

void ccf::common::PubBase::CheckForDeactivationUser ( )
virtual

Reimplemented in ccf::stdpub::PubFits.

◆ CreateObjectUser()

void ccf::common::PubBase::CreateObjectUser ( const std::string &  proc_thread_name,
const std::string &  pub_thread_name,
PubBase **  new_object 
)
virtual

◆ CreatePubObj()

void ccf::common::PubBase::CreatePubObj ( const std::string &  class_name,
const std::string &  proc_thread_name,
const std::string &  pub_thread_name,
PubBase **  new_object 
)
static

Static method to allocate and register a Data Publisher of the given type. A factory object of the given type (classname) shall be defined in the factory object registry (see ccf::common::PubBase::AddPubFactoryObj()). Each Data Publisher object instance shall be allocated before entering operations (data acquisition).

◆ Deactivate()

void ccf::common::PubBase::Deactivate ( )

◆ DeactivateUser()

void ccf::common::PubBase::DeactivateUser ( )
virtual

Reimplemented in ccf::stdpub::PubFits.

◆ Dismantle()

void ccf::common::PubBase::Dismantle ( )

◆ DismantleUser()

void ccf::common::PubBase::DismantleUser ( )
virtual

Reimplemented in ccf::stdpub::PubRtms, and ccf::stdpub::PubDdt.

◆ EstimateExecution()

void ccf::common::PubBase::EstimateExecution ( double &  duration,
int64_t &  nb_of_frames 
)

Provide an estimate for the duration and number of frames to be stored during a Recording Session according to the present setup.

◆ EstimateExecutionUser()

void ccf::common::PubBase::EstimateExecutionUser ( double &  duration,
int64_t &  nb_of_frames 
)
virtual

Reimplemented in ccf::stdpub::PubFits.

◆ GenId()

const std::string & ccf::common::PubBase::GenId ( const std::string &  proc_thread_name,
const std::string &  pub_thread_name 
)
static

Generate an ID for the Publisher.

◆ GetActivated()

bool ccf::common::PubBase::GetActivated ( ) const

◆ GetEnabled()

bool ccf::common::PubBase::GetEnabled ( ) const

◆ GetInitialised()

bool ccf::common::PubBase::GetInitialised ( ) const

◆ GetProcThreadName()

const std::string & ccf::common::PubBase::GetProcThreadName ( ) const

◆ GetPubFactoryObjs()

const std::map< std::string, std::shared_ptr< PubBase > > & ccf::common::PubBase::GetPubFactoryObjs ( )
static

Generate vector with references to the Publisher Factory Objects registered.

◆ GetPubId()

const std::string & ccf::common::PubBase::GetPubId ( ) const

◆ GetPublisherType()

PubType ccf::common::PubBase::GetPublisherType ( ) const

◆ GetPubObj()

void ccf::common::PubBase::GetPubObj ( const std::string &  proc_thread_name,
const std::string &  pub_thread_name,
PubBase **  pub_obj,
const bool  initialise = true 
)
static

Static method to get the address of a Data Publisher object with the given name and ID. If an object with this name/ID does not exist, it is automatically created. If "initialise" is true (default value), the object is initialised, i.e., the configuration reloaded.

◆ GetPubObjs()

void ccf::common::PubBase::GetPubObjs ( std::vector< PubBase * > &  pub_objs)
static

Get reference to all Data Publisher Objects registered.

◆ GetPubStatus() [1/2]

PublisherStatus & ccf::common::PubBase::GetPubStatus ( )

Get reference to internal Publisher Status object. Although all set-methods are semaphore protected, it shall be used with care.

◆ GetPubStatus() [2/2]

void ccf::common::PubBase::GetPubStatus ( PublisherStatus pub_stat) const

Make a snapshot of the current Publisher Status object.

◆ GetPubThreadName()

const std::string & ccf::common::PubBase::GetPubThreadName ( ) const

◆ HasPubObj()

bool ccf::common::PubBase::HasPubObj ( const std::string &  proc_thread_name,
const std::string &  pub_thread_name,
PubBase **  pub_obj 
)
static

Check if a Publisher object is defined.

◆ Initialise()

void ccf::common::PubBase::Initialise ( )

◆ InitialiseUser()

void ccf::common::PubBase::InitialiseUser ( )
virtual

◆ Publish()

void ccf::common::PubBase::Publish ( DataFrame frame,
const bool  force 
)

◆ PublishUser()

void ccf::common::PubBase::PublishUser ( DataFrame frame)
virtual

◆ ResetDbStatus()

void ccf::common::PubBase::ResetDbStatus ( ) const

Update status for a given Publisher Thread in the OLDB.

◆ SetActivated()

void ccf::common::PubBase::SetActivated ( const bool  activated)

◆ SetEnabled()

void ccf::common::PubBase::SetEnabled ( const bool  enabled)

◆ ToString()

std::string ccf::common::PubBase::ToString ( ) const

◆ UpdateDbStatus()

void ccf::common::PubBase::UpdateDbStatus ( ) const

Member Data Documentation

◆ m_initialised

bool ccf::common::PubBase::m_initialised
protected

◆ m_publisher_type

PubType ccf::common::PubBase::m_publisher_type
protected

◆ m_setup_enabled

bool ccf::common::PubBase::m_setup_enabled
protected

◆ m_stat_active

bool ccf::common::PubBase::m_stat_active
protected

The documentation for this class was generated from the following files: