ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ifw::ccf::common::RecipeBase Class Reference

Processing Recipe base class. All recipes shall be derived from this class. More...

#include <recipeBase.hpp>

Inheritance diagram for ifw::ccf::common::RecipeBase:
ifw::ccf::Base ifw::ccf::stdrecipe::RecipeCentroid

Public Member Functions

 RecipeBase (const std::string &proc_thread_name, const std::string &recipe_name)
 
 RecipeBase ()
 
virtual ~RecipeBase ()
 
void Initialise ()
 Initalise the object. Invoked after creating a new object from the factory object.
 
virtual void InitialiseUser ()
 Initialise the recipe object. See "Initialise()".
 
bool GetInitialised () const
 Return flag indicating if the recipe object has been initialised.
 
const std::string & GetRecipeId () const
 Get the ID of the recipe.
 
const std::string & GetProcThreadName () const
 Get the name of the Processing Thread, hosting the Recipe instance.
 
const std::string & GetRecipeName () const
 Get the name of the recipe.
 
const std::string & GetDbPath () const
 Generate DB path for this recipe.
 
void Process (DataFrame &frame)
 Execute the processing of the given frame.
 
void Enable ()
 Enable the recipe so that it will be invoked by the Processing Thread to which it belongs.
 
virtual void EnableUser ()
 
void Disable ()
 
virtual void DisableUser ()
 
bool GetEnabled () const
 Return the enabled status of the recipe.
 
virtual void ProcessUser (DataFrame &frame)
 User specific processing.
 
virtual void CreateObjectUser (const std::string &proc_thread_name, const std::string &recipe_name, std::shared_ptr< RecipeBase > &new_object)
 Instantiate a specific instance of the object.
 
void SetStatus (const ProcStatus status)
 Update status for a given Publisher Thread in the OLDB.
 
ProcStatus GetStatus () const
 Get status of the recipe object.
 
- Public Member Functions inherited from ifw::ccf::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class.
 

Static Public Member Functions

static const std::string & GenId (const std::string &proc_thread_name, const std::string &recipe_name)
 Generate the ID for this recipe from the Processing Thread and Recipe number.
 
template<class TYPE >
static void AddRecipeFactoryObj (TYPE &recipe_factory_obj)
 Static method to register a Data Publisher factory object in the internal registry.
 
static const std::map< std::string, std::shared_ptr< RecipeBase > > & GetRecipeFactoryObjs ()
 Statis method to retrieve references to the Recipe Factory Objects.
 
static void CreateRecipeObj (const std::string &class_name, const std::string &proc_thread_name, const std::string &recipe_name, std::shared_ptr< RecipeBase > &new_obj)
 
static void GetRecipeObj (const std::string &class_name, const std::string &proc_thread_name, std::shared_ptr< RecipeBase > &recipe_obj, const bool initialise=true)
 
static const std::map< std::string, std::shared_ptr< RecipeBase > > & GetRecipeObjs ()
 Get reference to all Processing Recipe objects registered.
 
static bool HasRecipeObj (const std::string &class_name, const std::string &proc_thread_name, std::shared_ptr< RecipeBase > &recipe_obj)
 Check if a Proc Recipe object is defined.
 
- Static Public Member Functions inherited from ifw::ccf::Base
static ifw::ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton).
 

Protected Member Functions

void SetEnabled (const bool enabled)
 Set the enabled status flag of the recipe object.
 
void DisableRecipe ()
 Disable the recipe so that it will not be invoked.
 
- Protected Member Functions inherited from ifw::ccf::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question.
 

Detailed Description

Processing Recipe base class. All recipes shall be derived from this class.

Constructor & Destructor Documentation

◆ RecipeBase() [1/2]

ifw::ccf::common::RecipeBase::RecipeBase ( const std::string & proc_thread_name,
const std::string & recipe_name )

Free the allocated recipe objects. Used internally by CCF. Free the allocated recipe factory objects. Used internally by CCF. Constructor instantiating a recipe object with the given Processing Thread and Recipe number and recipe name.

◆ RecipeBase() [2/2]

ifw::ccf::common::RecipeBase::RecipeBase ( )

◆ ~RecipeBase()

ifw::ccf::common::RecipeBase::~RecipeBase ( )
virtual

Member Function Documentation

◆ AddRecipeFactoryObj()

template<class TYPE >
static void ifw::ccf::common::RecipeBase::AddRecipeFactoryObj ( TYPE & recipe_factory_obj)
inlinestatic

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

◆ CreateObjectUser()

void ifw::ccf::common::RecipeBase::CreateObjectUser ( const std::string & proc_thread_name,
const std::string & recipe_name,
std::shared_ptr< RecipeBase > & new_object )
virtual

Instantiate a specific instance of the object.

◆ CreateRecipeObj()

void ifw::ccf::common::RecipeBase::CreateRecipeObj ( const std::string & class_name,
const std::string & proc_thread_name,
const std::string & recipe_name,
std::shared_ptr< RecipeBase > & new_obj )
static

Static method to allocate and register a Processing Recipe factory object of the given type. A factory object of the given type (classname) shall be defined in the factory object registry (see ifw::ccf::common::RecipeBase::AddRecipeFactoryObj()). Each Processing Recipe object instance shall be allocated before entering operations (data acquisition).

◆ Disable()

void ifw::ccf::common::RecipeBase::Disable ( )

Disable the recipe so that it will no longer be invoked by the Processing Thread to which it belongs.

◆ DisableRecipe()

void ifw::ccf::common::RecipeBase::DisableRecipe ( )
protected

Disable the recipe so that it will not be invoked.

◆ DisableUser()

void ifw::ccf::common::RecipeBase::DisableUser ( )
virtual

Specific implement of disable method. Need normally not be implemented by the user.

Reimplemented in ifw::ccf::stdrecipe::RecipeCentroid.

◆ Enable()

void ifw::ccf::common::RecipeBase::Enable ( )

Enable the recipe so that it will be invoked by the Processing Thread to which it belongs.

◆ EnableUser()

void ifw::ccf::common::RecipeBase::EnableUser ( )
virtual

Specific implement of enable method. Need normally not be implemented by the user.

Reimplemented in ifw::ccf::stdrecipe::RecipeCentroid.

◆ GenId()

const std::string & ifw::ccf::common::RecipeBase::GenId ( const std::string & proc_thread_name,
const std::string & recipe_name )
static

Generate the ID for this recipe from the Processing Thread and Recipe number.

◆ GetDbPath()

const std::string & ifw::ccf::common::RecipeBase::GetDbPath ( ) const

Generate DB path for this recipe.

◆ GetEnabled()

bool ifw::ccf::common::RecipeBase::GetEnabled ( ) const

Return the enabled status of the recipe.

◆ GetInitialised()

bool ifw::ccf::common::RecipeBase::GetInitialised ( ) const

Return flag indicating if the recipe object has been initialised.

◆ GetProcThreadName()

const std::string & ifw::ccf::common::RecipeBase::GetProcThreadName ( ) const

Get the name of the Processing Thread, hosting the Recipe instance.

◆ GetRecipeFactoryObjs()

const std::map< std::string, std::shared_ptr< RecipeBase > > & ifw::ccf::common::RecipeBase::GetRecipeFactoryObjs ( )
static

Statis method to retrieve references to the Recipe Factory Objects.

◆ GetRecipeId()

const std::string & ifw::ccf::common::RecipeBase::GetRecipeId ( ) const

Get the ID of the recipe.

◆ GetRecipeName()

const std::string & ifw::ccf::common::RecipeBase::GetRecipeName ( ) const

Get the name of the recipe.

◆ GetRecipeObj()

void ifw::ccf::common::RecipeBase::GetRecipeObj ( const std::string & class_name,
const std::string & proc_thread_name,
std::shared_ptr< RecipeBase > & recipe_obj,
const bool initialise = true )
static

Static method to get the address of a Processing Recipe 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.

◆ GetRecipeObjs()

const std::map< std::string, std::shared_ptr< RecipeBase > > & ifw::ccf::common::RecipeBase::GetRecipeObjs ( )
static

Get reference to all Processing Recipe objects registered.

◆ GetStatus()

ProcStatus ifw::ccf::common::RecipeBase::GetStatus ( ) const

Get status of the recipe object.

◆ HasRecipeObj()

bool ifw::ccf::common::RecipeBase::HasRecipeObj ( const std::string & class_name,
const std::string & proc_thread_name,
std::shared_ptr< RecipeBase > & recipe_obj )
static

Check if a Proc Recipe object is defined.

◆ Initialise()

void ifw::ccf::common::RecipeBase::Initialise ( )

Initalise the object. Invoked after creating a new object from the factory object.

◆ InitialiseUser()

void ifw::ccf::common::RecipeBase::InitialiseUser ( )
virtual

Initialise the recipe object. See "Initialise()".

Reimplemented in ifw::ccf::stdrecipe::RecipeCentroid.

◆ Process()

void ifw::ccf::common::RecipeBase::Process ( DataFrame & frame)

Execute the processing of the given frame.

◆ ProcessUser()

void ifw::ccf::common::RecipeBase::ProcessUser ( DataFrame & frame)
virtual

User specific processing.

Reimplemented in ifw::ccf::stdrecipe::RecipeCentroid.

◆ SetEnabled()

void ifw::ccf::common::RecipeBase::SetEnabled ( const bool enabled)
protected

Set the enabled status flag of the recipe object.

◆ SetStatus()

void ifw::ccf::common::RecipeBase::SetStatus ( const ProcStatus status)

Update status for a given Publisher Thread in the OLDB.


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