Robot Devastation
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rd::YarpImageManager Class Reference

Image input manager based in YARP. More...

#include <YarpImageManager.hpp>

Inheritance diagram for rd::YarpImageManager:
rd::ImageManager

Public Member Functions

virtual bool start ()
 Start to capture images. More...
 
virtual bool stop ()
 Stop capturing images.
 
virtual bool isStopped () const
 True if the manager is not active.
 
virtual bool setEnabled (bool enabled)
 Enables/disables notifications to listeners.
 
virtual bool configure (const std::string &parameter, const std::string &value)
 Configures a parameter with a value.
 
virtual Image getImage () const
 Return the last received image.
 
virtual ~YarpImageManager ()
 Destructor. Used to reset the local static reference after destroying this manager.
 
- Public Member Functions inherited from rd::ImageManager
bool addImageEventListener (ImageEventListener *listener)
 Adds a ImageEventListener to the list of observers to be notified of events.
 
bool removeImageEventListeners ()
 Unregisters all the ImageEventListener stored.
 

Static Public Member Functions

static bool RegisterManager ()
 Register this manager in the ImageManager registry so that can be used. More...
 
- Static Public Member Functions inherited from rd::ImageManager
static ImageManagergetImageManager ()
 Get a reference to the ImageManager. More...
 
static ImageManagergetImageManager (const std::string &id)
 Get a reference to the ImageManager. More...
 
static bool destroyImageManager ()
 Deallocate all the registered ImageManager.
 

Static Public Attributes

static const std::string id = "YARP"
 String that identifies this manager.
 

Protected Member Functions

void onRead (Image &image)
 Yarp event for incoming messages.
 

Private Member Functions

 YarpImageManager ()
 Constructor. More...
 
 YarpImageManager (const YarpImageManager &)
 
YarpImageManageroperator= (const YarpImageManager &)
 

Private Attributes

yarp::os::Semaphore semaphore
 Semaphore to make the image manipulation thread-safe.
 
Image image
 Last image received.
 
yarp::os::BufferedPort< Image > imagePort
 Yarp port to communicate with the remote camera.
 
std::string local_port_name
 Name of the local yarp port.
 
std::string remote_port_name
 Name of the camera (remote) yarp port.
 
bool stopped
 
bool enabled
 

Static Private Attributes

static YarpImageManageruniqueInstance = NULL
 Reference to this manager (unique instance)
 

Additional Inherited Members

- Static Protected Member Functions inherited from rd::ImageManager
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 inherited from rd::ImageManager
std::vector< ImageEventListener * > listeners
 Observers registered to be notified of image events.
 

Detailed Description

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 have to register the manager with the RegisterManager() method. Then, we can get the reference to the YarpImageManager with ImageManager::getImageManager(), using the corresponding id and access the manager with that reference.

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.

Constructor & Destructor Documentation

◆ YarpImageManager()

rd::YarpImageManager::YarpImageManager ( )
private

Constructor for this class is private, since the singleton can only be instantiated once, and the instantiation is done at the RegisterManager() method.

Member Function Documentation

◆ RegisterManager()

bool rd::YarpImageManager::RegisterManager ( )
static

It ensures that only one manager of this type is created (unique instance).

◆ start()

bool rd::YarpImageManager::start ( )
virtual

This function is supposed to be called after ImageManager configuration.

Implements rd::ImageManager.


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