Robot Devastation
|
Generic image input manager. More...
#include <ImageManager.hpp>
Public Member Functions | |
virtual bool | start ()=0 |
Start to capture images. More... | |
virtual bool | stop ()=0 |
Stop capturing images. | |
virtual bool | isStopped () const =0 |
True if the manager is not active. | |
virtual bool | setEnabled (bool enabled)=0 |
Enables/disables notifications to listeners. | |
virtual Image | getImage () const =0 |
Return the last received image. | |
bool | addImageEventListener (ImageEventListener *listener) |
Adds a ImageEventListener to the list of observers to be notified of events. | |
bool | removeImageEventListeners () |
Unregisters all the ImageEventListener stored. | |
virtual bool | configure (const std::string ¶meter, const std::string &value) |
Configures a parameter with a value. | |
Static Public Member Functions | |
static ImageManager * | getImageManager () |
Get a reference to the ImageManager. More... | |
static ImageManager * | getImageManager (const std::string &id) |
Get a reference to the ImageManager. More... | |
static bool | destroyImageManager () |
Deallocate all the registered ImageManager. | |
Static Protected Member Functions | |
static bool | Register (ImageManager *manager, const std::string &id) |
This function allows subclasses to install their unique instances in the singleton register to be selected later by the user. | |
Protected Attributes | |
std::vector< ImageEventListener * > | listeners |
Observers registered to be notified of image events. | |
Static Private Attributes | |
static ImageManager * | imageManagerInstance = NULL |
Stores the unique instance of the InputManager. | |
static std::string | currentId = "" |
Stores the id of the current unique instance used. | |
static std::map< std::string, ImageManager * > | imageManagerRegistry = std::map<std::string, rd::ImageManager *>() |
Stores all the ImageManager that have been registered. | |
ImageManager is a singleton text (only one instance of this object can exist, that is is shared by all the users). To use this class, we first register the needed subclasses of this class. This way, we can later get the reference to the ImageManager with getImageManager() the name of the desired registered subclass. Later calls to getImageManager() will return that selected subclass.
When the program finishes, the ImageManager can be deallocated using destroyImageManager().
Imnage events are broadcasted to the registered listeners, along with the reference to the manager that triggered them to be able to access the image.
|
static |
|
static |
|
pure virtual |
This function is supposed to be called after ImageManager configuration.
Implemented in rd::YarpLocalImageManager, rd::YarpImageManager, and rd::MockImageManager.