ifw-ccf  3.0.0-pre2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ccf::control::Application Class Reference

Implements the core CCF Control Application. More...

#include <application.hpp>

Inheritance diagram for ccf::control::Application:
ccf::common::AppBase

Public Member Functions

virtual ~Application ()
 
elt::mal::Mal & GetMal ()
 Return reference to the MAL (Singleton) instance. More...
 
int Execute (int argc, char *argv[])
 Initialise and execute the application. More...
 
void CreateThreads ()
 
void LoadInitSetup ()
 Load the Initialisation Setup specified in the configuration and install it. More...
 
void HandleSetup ()
 Handle the setup of the application. More...
 
void Dismantle ()
 
bool GetAcquisitionActive ()
 Returns true if image acquisition is active. More...
 
void StartAcquistion ()
 Instruct the system to start an acquisition (finite or infnite). More...
 
void StopAcquistion ()
 
void CheckStopAcquistion ()
 Check if the conditions are met to stop an ongoing acqusition session. More...
 
void IncrementFrameCounter ()
 Increment frame counter, counting the number of complete frames received. More...
 
std::string GetState ()
 Return the current state (status) of the SCXML state machine. More...
 
void SetRequestStatus (const std::string &request, const std::string &status)
 Set status of the given request. More...
 
std::string GetRequestStatus (const std::string &request) const
 Get the status of the given request. More...
 
std::string ListAdapters ()
 List the available adapters registered in this executable. More...
 
template<class COM_ADPT_TYPE , class SIM_COM_ADPT_TYPE >
void RegisterComAdapters (const COM_ADPT_TYPE &com_adapter_factory_obj, const SIM_COM_ADPT_TYPE &sim_com_adapter_factory_obj)
 Method to allocate and register the Communication Adapters. More...
 
ccf::common::ComAdptBaseGetComAdapter ()
 
void ConnectDevice ()
 Connect to the associated device. More...
 
void DisconnectDevice ()
 Disconnect from the associated device. More...
 
const std::vector< std::string > & GetProcThreadNames () const
 Get the names of the Processing Threads running. More...
 
const std::vector< std::string > & GetPubThreadNames (const std::string &proc_thread_name) const
 Get the names of the Publisher Threads running for a specific Processing Thread. More...
 
const std::list< PubThread * > & GetPubThreads () const
 Get the IDs of the Publisher Threads running. More...
 
bool IsProcThread (const std::string &thread_name)
 Returns bool if the thread is a Processing Thread. More...
 
bool IsPubThread (const std::string &thread_name)
 Returns bool if the thread is a Publisher Thread. More...
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 Disable copy constructor. More...
 
void UpdateRecordingStatus ()
 Disable assignment operator. More...
 
void SetActiveRecStatusObj (std::shared_ptr< recif::RecStatus > &active_rec)
 Set the Active Recording Status Object. More...
 
void UpdateActiveRecStatusObj (const ccf::common::PublisherStatus &sum_rec_pub_status)
 Update the Active Recording Status Object in memory and in the OLDB. More...
 
void UpdateRecStatusInDb ()
 Update the status of the current Recording Session in the DB. More...
 
void GetActiveRecStatus (std::shared_ptr< recif::RecStatus > &active_rec) const
 Get the currently active Recording status. More...
 
void MoveActiveRecStatusToHistory (const ccf::PubStatus status, std::shared_ptr< recif::RecStatus > &active_rec)
 Move the Active Rec Status object to the Rec Status History. More...
 
void SetRecordingStatus (const ccf::PubStatus status)
 Set the status of the an active Recording Session (Active Recording Object). More...
 
void GetRecStatus (const std::string &rec_id, std::shared_ptr< recif::RecStatus > &active_rec) const
 Check if a Recording with the given ID is found and returns its status. More...
 
void GetMostRecentRecStatus (std::shared_ptr< recif::RecStatus > &active_rec) const
 Get the information about the most recent Recording (active or in the history). More...
 
void AddRecWaitRequest (std::shared_ptr< RecWaitRequest > &req_wait_req)
 Add a ReqWaitRequest in the internal registry. More...
 
void CheckRecWaitRequests (const bool recording_completed=false)
 Check if there are pending requests from RecWait Requests and send response if needed. More...
 
void CleanUpRecWaitRequests ()
 Check if there are RecWait Requests that can be removed from the queue. More...
 
- Public Member Functions inherited from ccf::common::AppBase
 AppBase ()
 
 ~AppBase ()
 

Static Public Member Functions

static ApplicationInstance ()
 Return reference to unique instance of the application class. More...
 
- Static Public Member Functions inherited from ccf::common::AppBase
static rad::SMAdapter & StateMachine ()
 Return reference to state machine engine. More...
 
static bool RecordingActive ()
 Return true if a Recording Session is ongoing. More...
 
static boost::asio::io_context & IoContext ()
 Return reference to Asio I/O Service instance. More...
 

Static Public Attributes

static Applications_app_instance = nullptr
 Singleton instance. More...
 

Detailed Description

Implements the core CCF Control Application.

It initialises and dismantles the application and provides access to the various, common data of the application.

Constructor & Destructor Documentation

◆ ~Application()

ccf::control::Application::~Application ( )
virtual

◆ Application()

ccf::control::Application::Application ( const Application )
delete

Member Function Documentation

◆ AddRecWaitRequest()

void ccf::control::Application::AddRecWaitRequest ( std::shared_ptr< RecWaitRequest > &  req_wait_req)

Add a ReqWaitRequest in the internal registry.

◆ CheckRecWaitRequests()

void ccf::control::Application::CheckRecWaitRequests ( const bool  recording_completed = false)

Check if there are pending requests from RecWait Requests and send response if needed.

◆ CheckStopAcquistion()

void ccf::control::Application::CheckStopAcquistion ( )

Check if the conditions are met to stop an ongoing acqusition session.

◆ CleanUpRecWaitRequests()

void ccf::control::Application::CleanUpRecWaitRequests ( )

Check if there are RecWait Requests that can be removed from the queue.

◆ ConnectDevice()

void ccf::control::Application::ConnectDevice ( )

Connect to the associated device.

◆ CreateThreads()

void ccf::control::Application::CreateThreads ( )

Create the internal worker threads according to the configuration loaded. Existing threads will be deleted first.

◆ DisconnectDevice()

void ccf::control::Application::DisconnectDevice ( )

Disconnect from the associated device.

◆ Dismantle()

void ccf::control::Application::Dismantle ( )

Dismantle the application, releasing resources. E.g. the "Dismantle()" methods of the Recipe and Publisher Adapters are invoked.

◆ Execute()

int ccf::control::Application::Execute ( int  argc,
char *  argv[] 
)

Initialise and execute the application.

◆ GetAcquisitionActive()

bool ccf::control::Application::GetAcquisitionActive ( )

Returns true if image acquisition is active.

◆ GetActiveRecStatus()

void ccf::control::Application::GetActiveRecStatus ( std::shared_ptr< recif::RecStatus > &  active_rec) const

Get the currently active Recording status.

◆ GetComAdapter()

ccf::common::ComAdptBase & ccf::control::Application::GetComAdapter ( )

Return the reference to the appropriate Communication Adapter (real mode or simulation adapter).

◆ GetMal()

elt::mal::Mal & ccf::control::Application::GetMal ( )

Return reference to the MAL (Singleton) instance.

◆ GetMostRecentRecStatus()

void ccf::control::Application::GetMostRecentRecStatus ( std::shared_ptr< recif::RecStatus > &  active_rec) const

Get the information about the most recent Recording (active or in the history).

◆ GetProcThreadNames()

const std::vector< std::string > & ccf::control::Application::GetProcThreadNames ( ) const

Get the names of the Processing Threads running.

◆ GetPubThreadNames()

const std::vector< std::string > & ccf::control::Application::GetPubThreadNames ( const std::string &  proc_thread_name) const

Get the names of the Publisher Threads running for a specific Processing Thread.

◆ GetPubThreads()

const std::list< ccf::control::PubThread * > & ccf::control::Application::GetPubThreads ( ) const

Get the IDs of the Publisher Threads running.

◆ GetRecStatus()

void ccf::control::Application::GetRecStatus ( const std::string &  rec_id,
std::shared_ptr< recif::RecStatus > &  active_rec 
) const

Check if a Recording with the given ID is found and returns its status.

◆ GetRequestStatus()

std::string ccf::control::Application::GetRequestStatus ( const std::string &  request) const

Get the status of the given request.

◆ GetState()

std::string ccf::control::Application::GetState ( )

Return the current state (status) of the SCXML state machine.

◆ HandleSetup()

void ccf::control::Application::HandleSetup ( )

Handle the setup of the application.

◆ IncrementFrameCounter()

void ccf::control::Application::IncrementFrameCounter ( )

Increment frame counter, counting the number of complete frames received.

◆ Instance()

Application & ccf::control::Application::Instance ( )
static

Return reference to unique instance of the application class.

◆ IsProcThread()

bool ccf::control::Application::IsProcThread ( const std::string &  thread_name)

Returns bool if the thread is a Processing Thread.

◆ IsPubThread()

bool ccf::control::Application::IsPubThread ( const std::string &  thread_name)

Returns bool if the thread is a Publisher Thread.

◆ ListAdapters()

std::string ccf::control::Application::ListAdapters ( )

List the available adapters registered in this executable.

◆ LoadInitSetup()

void ccf::control::Application::LoadInitSetup ( )

Load the Initialisation Setup specified in the configuration and install it.

◆ MoveActiveRecStatusToHistory()

void ccf::control::Application::MoveActiveRecStatusToHistory ( const ccf::PubStatus  status,
std::shared_ptr< recif::RecStatus > &  active_rec 
)

Move the Active Rec Status object to the Rec Status History.

◆ operator=()

Application& ccf::control::Application::operator= ( const Application )
delete

Disable copy constructor.

◆ RegisterComAdapters()

template<class COM_ADPT_TYPE , class SIM_COM_ADPT_TYPE >
void ccf::control::Application::RegisterComAdapters ( const COM_ADPT_TYPE &  com_adapter_factory_obj,
const SIM_COM_ADPT_TYPE &  sim_com_adapter_factory_obj 
)
inline

Method to allocate and register the Communication Adapters.

◆ SetActiveRecStatusObj()

void ccf::control::Application::SetActiveRecStatusObj ( std::shared_ptr< recif::RecStatus > &  active_rec)

Set the Active Recording Status Object.

◆ SetRecordingStatus()

void ccf::control::Application::SetRecordingStatus ( const ccf::PubStatus  status)

Set the status of the an active Recording Session (Active Recording Object).

◆ SetRequestStatus()

void ccf::control::Application::SetRequestStatus ( const std::string &  request,
const std::string &  status 
)

Set status of the given request.

◆ StartAcquistion()

void ccf::control::Application::StartAcquistion ( )

Instruct the system to start an acquisition (finite or infnite).

◆ StopAcquistion()

void ccf::control::Application::StopAcquistion ( )

Instruct the system to stopt an ongoing acquisition. If none is active, no actions are performed.

◆ UpdateActiveRecStatusObj()

void ccf::control::Application::UpdateActiveRecStatusObj ( const ccf::common::PublisherStatus sum_rec_pub_status)

Update the Active Recording Status Object in memory and in the OLDB.

◆ UpdateRecordingStatus()

void ccf::control::Application::UpdateRecordingStatus ( )

Disable assignment operator.

Update the Recording status in the active recording object and in the OLDB.

◆ UpdateRecStatusInDb()

void ccf::control::Application::UpdateRecStatusInDb ( )

Update the status of the current Recording Session in the DB.

Member Data Documentation

◆ s_app_instance

Application * ccf::control::Application::s_app_instance = nullptr
static

Singleton instance.


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