23 #include <core/exception.h> 24 #include <logging/logger.h> 25 #include <plugins/asp/aspect/clingo_access.h> 26 #include <plugins/asp/aspect/clingo_control_manager.h> 65 const std::string &log_component_name)
67 if (controls_.count(ctrl_name) != 0) {
68 throw Exception(
"Clingo Control '%s' already exists!", ctrl_name.c_str());
74 controls_.emplace(ctrl_name, ctrl);
87 controls_.erase(ctrl_name);
95 const std::unordered_map<std::string, LockPtr<ClingoAccess>> &
ClingoControlManager(void)
Constructor.
Fawkes library namespace.
void set_logger(Logger *logger)
Sets the logger for all Clingo Controls.
LockPtr<> is a reference-counting shared lockable smartpointer.
virtual ~ClingoControlManager(void)
Destructor.
Base class for exceptions in Fawkes.
LockPtr< ClingoAccess > create_control(const std::string &ctrl_name, const std::string &log_component_name)
Create a new control.
void destroy_control(const std::string &ctrl_name)
"Destroys" the named control.
A wrapper around the clingo control, to control the solving process.
const std::unordered_map< std::string, LockPtr< ClingoAccess > > & controls(void) const
Get map of controls.