Fawkes API Fawkes Development Version
fawkes::ClingoControlManager Class Reference

The Clingo Control Manager creates and maintains Clingo Controls. More...

#include <>>

Public Member Functions

 ClingoControlManager (void)
 Constructor. More...
 
virtual ~ClingoControlManager (void)
 Destructor. More...
 
void set_logger (Logger *logger)
 Sets the logger for all Clingo Controls. More...
 
LockPtr< ClingoAccesscreate_control (const std::string &ctrl_name, const std::string &log_component_name)
 Create a new control. More...
 
void destroy_control (const std::string &ctrl_name)
 "Destroys" the named control. More...
 
const std::unordered_map< std::string, LockPtr< ClingoAccess > > & controls (void) const
 Get map of controls. More...
 

Detailed Description

The Clingo Control Manager creates and maintains Clingo Controls.

Author
Björn Schäpers

Definition at line 36 of file clingo_control_manager.h.

Constructor & Destructor Documentation

◆ ClingoControlManager()

fawkes::ClingoControlManager::ClingoControlManager ( void  )

Constructor.

Definition at line 36 of file clingo_control_manager.cpp.

◆ ~ClingoControlManager()

fawkes::ClingoControlManager::~ClingoControlManager ( void  )
virtual

Destructor.

Definition at line 41 of file clingo_control_manager.cpp.

Member Function Documentation

◆ controls()

const std::unordered_map< std::string, LockPtr< ClingoAccess > > & fawkes::ClingoControlManager::controls ( void  ) const

Get map of controls.

Returns
The map from control name to control lock ptr.

Definition at line 96 of file clingo_control_manager.cpp.

◆ create_control()

LockPtr< ClingoAccess > fawkes::ClingoControlManager::create_control ( const std::string &  ctrl_name,
const std::string &  log_component_name 
)

Create a new control.

The control is registered internally under the specified name. It must be destroyed when done with it. Only a single control can be created for a particular control name.

Parameters
[in]ctrl_nameThe Name by which to register the control.
[in]log_component_nameThe Prefix for log entries. If empty it will be set to "Clingo".
Returns
A new plain Clingo Control.

Definition at line 64 of file clingo_control_manager.cpp.

◆ destroy_control()

void fawkes::ClingoControlManager::destroy_control ( const std::string &  ctrl_name)

"Destroys" the named control.

Only ever destroy controls which you have created yourself. It will be unregistered, but live as long as there is a LockPtr reference to it.

Parameters
[in]ctrl_nameThe name of the control to destroy.

Definition at line 85 of file clingo_control_manager.cpp.

◆ set_logger()

void fawkes::ClingoControlManager::set_logger ( Logger logger)

Sets the logger for all Clingo Controls.

Parameters
[in]loggerThe logger.

Definition at line 50 of file clingo_control_manager.cpp.

Referenced by ASPThread::init().


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