#include <ArCameraCollection.h>
ArCameraCollection is a repository for information about each of the cameras that are installed on the robot. It enables clients to adjust to robots with varying camera configurations.
Three main types of information are maintained for each camera:
Callbacks may be installed on the collection to be notified whenever the collection is modified. This notification only occurs when cameras, commands, or parameters are added or removed. (The editing of parameters is merely passed to the parameter source.)
ArCameraCollection is thread-safe.
Definition at line 78 of file ArCameraCollection.h.
Public Member Functions | |
virtual bool | addCamera (const char *cameraName, const char *cameraType, const char *displayName, const char *displayType) |
Adds a new camera to the collection. | |
virtual bool | addCameraCommand (const char *cameraName, const char *command, const char *cameraCommandName, int requestInterval=-1) |
Adds the specified command to the camera. | |
virtual bool | addModifiedCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST) |
Adds a callback to be invoked when the camera collection has been modified. | |
virtual bool | addParameter (const char *cameraName, ArCameraParameterSource *source, const ArConfigArg ¶m) |
Adds the specified parameter to the camera. | |
ArCameraCollection () | |
Constructor. | |
virtual void | endUpdate () |
Ends an update to the collection. | |
virtual bool | exists (const char *cameraName, const char *command) |
Returns whether the specified command is defined for a particular camera. | |
virtual bool | exists (const char *cameraName) |
Returns whether the specified camera is contained in the collection. | |
virtual void | getCameraCommands (const char *cameraName, std::list< std::string > &outList) |
Returns the generic commands that are supported by the specified camera. | |
virtual void | getCameraNames (std::list< std::string > &outList) |
Returns the names of the cameras that are in the collection. | |
virtual const char * | getCameraType (const char *cameraName) |
Returns the type of the specified camera. | |
virtual const char * | getCommandName (const char *cameraName, const char *command) |
Returns the specific camera command (/ network packet) name for the generic command. | |
virtual const char * | getDisplayName (const char *cameraName) |
Returns the display name of the specified camera. | |
virtual const char * | getDisplayType (const char *cameraName) |
Returns the display type of the specified camera. | |
virtual bool | getParameter (const char *cameraName, const char *parameterName, ArConfigArg ¶mOut) |
Returns the specified camera parameter. | |
virtual void | getParameterNames (const char *cameraName, std::list< std::string > &outList) |
Returns the names of the parameters for the specified camera. | |
virtual int | getRequestInterval (const char *cameraName, const char *command) |
Returns the default request interval for the specified camera command. | |
int | lock () |
Lock the collection. | |
virtual bool | parameterExists (const char *cameraName, const char *paramName) |
Returns whether the specified parameter has been defined for a particular camera. | |
virtual bool | removeCamera (const char *cameraName) |
Removes the specified camera from the collection. | |
virtual bool | removeCameraCommand (const char *cameraName, const char *command) |
Removes the specified command from the camera. | |
virtual bool | removeModifiedCB (ArFunctor *functor) |
Removes a callback from the modified notification list. | |
virtual bool | removeParameter (const char *cameraName, const char *paramName) |
Removes the specified parameter from the camera. | |
virtual bool | setParameter (const char *cameraName, const ArConfigArg ¶m) |
Updates the specified camera parameter. | |
virtual void | startUpdate () |
Starts an update to the collection. | |
int | tryLock () |
Try to lock the collection without blocking. | |
int | unlock () |
Unlock the collection. | |
virtual | ~ArCameraCollection () |
Destructor. | |
Protected Member Functions | |
CameraInfo * | findCameraInfo (const char *cameraName) |
Returns a pointer to the CameraInfo for the specified camera. | |
CommandInfo * | findCommandInfo (const char *cameraName, const char *commandName) |
Returns a pointer to the CommandInfo for the specified generic command. | |
ParamInfo * | findParamInfo (const char *cameraName, const char *paramName) |
Returns a pointer to the ParamInfo for the specified parameter. | |
void | notifyModifiedListeners () |
Invokes each of the callbacks when the collection has been modified. | |
void | setModified () |
Sets an indication that the collection has been modified. | |
Protected Attributes | |
std::map< std::string, CameraInfo * > | myCameraToInfoMap |
Map of camera names to the associated camera information. | |
bool | myIsModified |
Whether the collection has been modified (since the last notification). | |
bool | myIsUpdatesEnabled |
Whether updates are currently enabled. | |
std::list< ArFunctor * > | myModifiedCBList |
List of callbacks to be notified when the collection is modified. | |
ArMutex | myMutex |
Mutex for multi-threaded access. | |
Classes | |
struct | CameraInfo |
Information regarding a single camera. More... | |
struct | CommandInfo |
Information regarding a particular camera command. More... | |
struct | ParamInfo |
Information regarding a particular camera parameter. More... |
|
Adds a new camera to the collection.
Definition at line 47 of file ArCameraCollection.cpp. |
|
Adds the specified command to the camera.
Definition at line 106 of file ArCameraCollection.cpp. |
|
Adds a callback to be invoked when the camera collection has been modified.
Definition at line 490 of file ArCameraCollection.cpp. |
|
Adds the specified parameter to the camera.
Definition at line 176 of file ArCameraCollection.cpp. |
|
Ends an update to the collection. A call to startUpdate() must eventually be followed by a call to endUpdate(). Definition at line 478 of file ArCameraCollection.cpp. |
|
Returns the generic commands that are supported by the specified camera.
Definition at line 299 of file ArCameraCollection.cpp. |
|
Returns the names of the cameras that are in the collection.
Definition at line 231 of file ArCameraCollection.cpp. |
|
Returns the type of the specified camera.
Definition at line 248 of file ArCameraCollection.cpp. |
|
Returns the specific camera command (/ network packet) name for the generic command.
Definition at line 320 of file ArCameraCollection.cpp. |
|
Returns the display name of the specified camera.
Definition at line 265 of file ArCameraCollection.cpp. |
|
Returns the display type of the specified camera.
Definition at line 282 of file ArCameraCollection.cpp. |
|
Returns the specified camera parameter.
Definition at line 379 of file ArCameraCollection.cpp. |
|
Returns the names of the parameters for the specified camera.
Definition at line 359 of file ArCameraCollection.cpp. |
|
Returns the default request interval for the specified camera command.
Definition at line 339 of file ArCameraCollection.cpp. |
|
Removes the specified camera from the collection.
Definition at line 78 of file ArCameraCollection.cpp. |
|
Removes the specified command from the camera.
Definition at line 144 of file ArCameraCollection.cpp. |
|
Removes a callback from the modified notification list.
Definition at line 524 of file ArCameraCollection.cpp. |
|
Removes the specified parameter from the camera.
Definition at line 205 of file ArCameraCollection.cpp. |
|
Updates the specified camera parameter.
Definition at line 399 of file ArCameraCollection.cpp. |
|
Starts an update to the collection. This method may be used when multiple changes are being made to the collection. While an update is in progress, the modified callbacks will not be invoked. The endUpdate() method should be called after all of the changes are complete (and then the modified callbacks will be invoked). Definition at line 469 of file ArCameraCollection.cpp. |