Fawkes API
Fawkes Development Version
|
CLIPS environment manager. More...
#include <>>
Public Member Functions | |
CLIPSEnvManager (Logger *logger, Clock *clock, std::string &clips_dir) | |
Constructor. More... | |
virtual | ~CLIPSEnvManager () |
Destructor. More... | |
LockPtr< CLIPS::Environment > | create_env (const std::string &env_name, const std::string &log_component_name) |
Create a new environment. More... | |
void | destroy_env (const std::string &env_name) |
Destroy the named environment. More... | |
void | add_features (const std::list< CLIPSFeature *> &features) |
Add a feature by name. More... | |
void | remove_features (const std::list< CLIPSFeature *> &features) |
Remove a feature by name. More... | |
void | assert_can_remove_features (const std::list< CLIPSFeature *> &features) |
Assert that a feature can be removed. More... | |
std::map< std::string, LockPtr< CLIPS::Environment > > | environments () const |
Get map of environments. More... | |
CLIPS environment manager.
The CLIPS environment manager creates and maintains CLIPS environments, registers features and provides them to the CLIPS environments, and allows access to any and all CLIPS environments.
Definition at line 42 of file clips_env_manager.h.
fawkes::CLIPSEnvManager::CLIPSEnvManager | ( | Logger * | logger, |
Clock * | clock, | ||
std::string & | clips_dir | ||
) |
Constructor.
logger | logger to log messages from created environments |
clock | clock to get time from for (now) |
clips_dir | path where to look for CLIPS files |
Definition at line 165 of file clips_env_manager.cpp.
|
virtual |
Destructor.
Definition at line 173 of file clips_env_manager.cpp.
void fawkes::CLIPSEnvManager::add_features | ( | const std::list< CLIPSFeature *> & | features | ) |
Add a feature by name.
features | CLIPS feature maintainers to add |
Definition at line 399 of file clips_env_manager.cpp.
Referenced by CLIPSThread::init().
void fawkes::CLIPSEnvManager::assert_can_remove_features | ( | const std::list< CLIPSFeature *> & | features | ) |
Assert that a feature can be removed.
The feature will not actually be removed, it will just be checked if this would work without problem.
features | list of features to query for removal |
Exception | thrown with a descriptive message if the feature cannot be removed because it is still in use |
Definition at line 432 of file clips_env_manager.cpp.
LockPtr< CLIPS::Environment > fawkes::CLIPSEnvManager::create_env | ( | const std::string & | env_name, |
const std::string & | log_component_name | ||
) |
Create a new environment.
The environment is registered internally under the specified name. It must be destroyed when done with it. Only a single environment can be created for a particular environment name.
env_name | name by which to register environment |
log_component_name | prefix for log entries |
Definition at line 232 of file clips_env_manager.cpp.
void fawkes::CLIPSEnvManager::destroy_env | ( | const std::string & | env_name | ) |
Destroy the named environment.
Only ever destroy environments which you have created yourself.
env_name | name of the environment to destroy |
Definition at line 267 of file clips_env_manager.cpp.
std::map< std::string, LockPtr< CLIPS::Environment > > fawkes::CLIPSEnvManager::environments | ( | ) | const |
Get map of environments.
Definition at line 293 of file clips_env_manager.cpp.
References fawkes::Time::get_sec(), and fawkes::Time::get_usec().
void fawkes::CLIPSEnvManager::remove_features | ( | const std::list< CLIPSFeature *> & | features | ) |
Remove a feature by name.
features | list of features to remove |
Exception | thrown with a descriptive message if the feature cannot be removed because it is still in use |
Definition at line 452 of file clips_env_manager.cpp.