Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

CameraStreamBehavior Class Reference

#include <CameraStreamBehavior.h>

Inheritance diagram for CameraStreamBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

Base class for camera streaming communication classes, handles upstream communication.

This class isn't meant to be run directly -- it just provides common functionality for its subclasses.

Definition at line 11 of file CameraStreamBehavior.h.

Public Member Functions

virtual void processEvent (const EventBase &e)
 By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.
virtual std::string getDescription () const
 Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).
int receiveData (char *data, unsigned int len)
 called when new data is available (currently, only to toggle sensor sending)
void sendSensors ()
 causes current sensor values to be sent through curSocket (along with video data)

Static Public Member Functions

static std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Protected Member Functions

 CameraStreamBehavior (const std::string &name, Socket *&s)
 constructor, protected because you're not intended to instantiate this directly
 CameraStreamBehavior (const std::string &classname, const std::string &name, Socket *&s)
 constructor, protected because you're not intended to instantiate this directly

Protected Attributes

Socket *& curSocket
 the socket over which to send updates
unsigned int sensorListeners
 number of times startSensors has been sent, minus number of times stopSensors has been sent
unsigned int lastProcessedTime
 timestamp of last sensor update sent

Private Member Functions

 CameraStreamBehavior (const CameraStreamBehavior &)
 don't call (copy constructor)
CameraStreamBehavioroperator= (const CameraStreamBehavior &)
 don't call (assignment operator)


Constructor & Destructor Documentation

CameraStreamBehavior::CameraStreamBehavior ( const std::string &  name,
Socket *&  s 
) [inline, protected]

constructor, protected because you're not intended to instantiate this directly

Parameters:
name the name of the instance and the class
s the subclass's socket, a reference is stored so CameraStreamBehavior will always have access to the current socket

Definition at line 27 of file CameraStreamBehavior.h.

CameraStreamBehavior::CameraStreamBehavior ( const std::string &  classname,
const std::string &  name,
Socket *&  s 
) [inline, protected]

constructor, protected because you're not intended to instantiate this directly

Parameters:
classname the name of the class type
name the name of the instance
s the subclass's socket, a reference is stored so CameraStreamBehavior will always have access to the current socket

Definition at line 34 of file CameraStreamBehavior.h.


Member Function Documentation

static std::string CameraStreamBehavior::getClassDescription (  )  [inline, static]

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

If you do override this, also consider overriding getDescription() to return it

Reimplemented from BehaviorBase.

Reimplemented in RawCamBehavior, and SegCamBehavior.

Definition at line 16 of file CameraStreamBehavior.h.

Referenced by getDescription().

virtual std::string CameraStreamBehavior::getDescription (  )  const [inline, virtual]

Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!)

This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.

Reimplemented from BehaviorBase.

Reimplemented in RawCamBehavior, and SegCamBehavior.

Definition at line 17 of file CameraStreamBehavior.h.


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

Tekkotsu v3.0
Generated Fri May 11 20:07:48 2007 by Doxygen 1.4.7