Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

ArServerHandlerCameraCollection Class Reference

ArServerHandlerCameraCollection defines the network packet handlers to transmit information regarding the cameras that are installed on the robot. More...

#include <ArServerHandlerCameraCollection.h>

List of all members.

Public Member Functions

 ArServerHandlerCameraCollection (ArServerBase *server, ArCameraCollection *cameraCollection)
void getCameraList (ArServerClient *client, ArNetPacket *packet)
void handleCameraCollectionModified ()
 Callback executed when the associated camera collection is modified.
void setParams (ArServerClient *client, ArNetPacket *packet)
virtual ~ArServerHandlerCameraCollection ()
 Destructor.

Static Public Attributes

static const char * COLLECTION_UPDATED_PACKET_NAME
 Name of the network packet broadcast when the collection is modified.
static const char * COMMAND_GROUP
 Command group for these packets.
static const char * GET_COLLECTION_PACKET_NAME
 Name of the network packet to get the camera list.
static const char * PARAMS_UPDATED_PACKET_NAME
 Name of the network packet broadcast when a parameter value is modified.
static const char * SET_PARAMS_PACKET_NAME
 Name of the network packet to set a particular camera parameter.

Protected Attributes

ArCameraCollectionmyCameraCollection
 The associated camera collection.
ArFunctormyCollectionModifiedCB
 Notification callback when the camera collection has been modified.
ArFunctor2< ArServerClient *,
ArNetPacket * > * 
myGetCameraListCB
 Server callback for the get camera list request.
ArServerBasemyServer
 The server used to send/receive requests.
ArFunctor2< ArServerClient *,
ArNetPacket * > * 
mySetParamCB
 Server callback for the set parameter request.


Detailed Description

ArServerHandlerCameraCollection defines the network packet handlers to transmit information regarding the cameras that are installed on the robot.

This class handles the following requests:

When a camera is added or a parameter changes, the server broadcasts the following packets to each client:

Note that the cameraParamUpdated is currently only sent in response to a setCameraParams request. That is, it does not monitor the actual parameter values in the ArCameraCollection.

In order to manipulate a particular camera, see ArServerHandlerCamera and ArVideoServer.

Definition at line 87 of file ArServerHandlerCameraCollection.h.


Constructor & Destructor Documentation

ArServerHandlerCameraCollection::ArServerHandlerCameraCollection ArServerBase server,
ArCameraCollection cameraCollection
 

Parameters:
server the ArServerBase * used to send/receive requests
cameraCollection the ArCameraCollection * to be transmitted

Definition at line 48 of file ArServerHandlerCameraCollection.cpp.

References getCameraList(), handleCameraCollectionModified(), and setParams().

ArServerHandlerCameraCollection::~ArServerHandlerCameraCollection  )  [virtual]
 

Destructor.

Definition at line 114 of file ArServerHandlerCameraCollection.cpp.

References myCameraCollection, myCollectionModifiedCB, and ArCameraCollection::removeModifiedCB().


Member Function Documentation

void ArServerHandlerCameraCollection::getCameraList ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that is making the request
packet the ArNetPacket * that contains the request

Definition at line 130 of file ArServerHandlerCameraCollection.cpp.

References ArBasePacket::byte2ToBuf(), ArBasePacket::byte4ToBuf(), client, ArClientArg::createPacket(), ArCameraCollection::getCameraCommands(), ArCameraCollection::getCameraNames(), ArCameraCollection::getCameraType(), ArCameraCollection::getCommandName(), ArCameraCollection::getDisplayName(), ArCameraCollection::getDisplayType(), ArCameraCollection::getParameter(), ArCameraCollection::getParameterNames(), ArCameraCollection::getRequestInterval(), ArLog::log(), myCameraCollection, ArClientBase::sendPacketTcp(), and ArBasePacket::strToBuf().

Referenced by ArServerHandlerCameraCollection().

void ArServerHandlerCameraCollection::handleCameraCollectionModified  ) 
 

Callback executed when the associated camera collection is modified.

Definition at line 314 of file ArServerHandlerCameraCollection.cpp.

References ArServerBase::broadcastPacketTcp(), COLLECTION_UPDATED_PACKET_NAME, and myServer.

Referenced by ArServerHandlerCameraCollection().

void ArServerHandlerCameraCollection::setParams ArServerClient client,
ArNetPacket packet
 

Parameters:
client the ArServerClient * that is making the request
packet the ArNetPacket * that contains the request

Definition at line 226 of file ArServerHandlerCameraCollection.cpp.

References ArClientArg::argValueToBuf(), ArServerBase::broadcastPacketTcp(), ArClientArg::bufToArgValue(), ArBasePacket::bufToStr(), client, ArConfigArg::getName(), ArCameraCollection::getParameter(), ArLog::log(), myCameraCollection, myServer, PARAMS_UPDATED_PACKET_NAME, ArClientBase::sendPacketTcp(), ArCameraCollection::setParameter(), and ArBasePacket::strToBuf().

Referenced by ArServerHandlerCameraCollection().


Member Data Documentation

const char * ArServerHandlerCameraCollection::COLLECTION_UPDATED_PACKET_NAME [static]
 

Initial value:

 
                        "cameraListUpdated"
Name of the network packet broadcast when the collection is modified.

Definition at line 36 of file ArServerHandlerCameraCollection.cpp.

Referenced by handleCameraCollectionModified().

const char * ArServerHandlerCameraCollection::COMMAND_GROUP [static]
 

Initial value:

                        "CameraInfo"
Command group for these packets.

Definition at line 43 of file ArServerHandlerCameraCollection.cpp.

const char * ArServerHandlerCameraCollection::GET_COLLECTION_PACKET_NAME [static]
 

Initial value:

                        "getCameraList"
Name of the network packet to get the camera list.

Definition at line 34 of file ArServerHandlerCameraCollection.cpp.

ArCameraCollection* ArServerHandlerCameraCollection::myCameraCollection [protected]
 

The associated camera collection.

Definition at line 153 of file ArServerHandlerCameraCollection.h.

Referenced by getCameraList(), setParams(), and ~ArServerHandlerCameraCollection().

ArFunctor* ArServerHandlerCameraCollection::myCollectionModifiedCB [protected]
 

Notification callback when the camera collection has been modified.

Definition at line 161 of file ArServerHandlerCameraCollection.h.

Referenced by ~ArServerHandlerCameraCollection().

ArFunctor2<ArServerClient *, ArNetPacket *>* ArServerHandlerCameraCollection::myGetCameraListCB [protected]
 

Server callback for the get camera list request.

Definition at line 156 of file ArServerHandlerCameraCollection.h.

ArServerBase* ArServerHandlerCameraCollection::myServer [protected]
 

The server used to send/receive requests.

Definition at line 151 of file ArServerHandlerCameraCollection.h.

Referenced by handleCameraCollectionModified(), and setParams().

ArFunctor2<ArServerClient *, ArNetPacket *>* ArServerHandlerCameraCollection::mySetParamCB [protected]
 

Server callback for the set parameter request.

Definition at line 158 of file ArServerHandlerCameraCollection.h.

const char * ArServerHandlerCameraCollection::PARAMS_UPDATED_PACKET_NAME [static]
 

Initial value:

 
                        "cameraParamUpdated"
Name of the network packet broadcast when a parameter value is modified.

Definition at line 40 of file ArServerHandlerCameraCollection.cpp.

Referenced by setParams().

const char * ArServerHandlerCameraCollection::SET_PARAMS_PACKET_NAME [static]
 

Initial value:

                        "setCameraParams"
Name of the network packet to set a particular camera parameter.

Definition at line 38 of file ArServerHandlerCameraCollection.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:51 2007 for ArNetworking by  doxygen 1.4.0