Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

CameraStreamBehavior Class Reference

#include <CameraStreamBehavior.h>

Inheritance diagram for CameraStreamBehavior:

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.

CameraStreamBehavior::CameraStreamBehavior ( const CameraStreamBehavior  )  [private]

don't call (copy constructor)


Member Function Documentation

void CameraStreamBehavior::processEvent ( const EventBase  )  [virtual]

By defining here, allows you to get away with not supplying a processEvent() function for the EventListener interface. By default, does nothing.

Reimplemented from BehaviorBase.

Reimplemented in RawCamBehavior, and SegCamBehavior.

Definition at line 12 of file CameraStreamBehavior.cc.

Referenced by SegCamBehavior::processEvent(), and RawCamBehavior::processEvent().

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.

int CameraStreamBehavior::receiveData ( char *  data,
unsigned int  len 
)

called when new data is available (currently, only to toggle sensor sending)

Definition at line 19 of file CameraStreamBehavior.cc.

Referenced by SegCamBehavior::networkCallback(), and RawCamBehavior::networkCallback().

void CameraStreamBehavior::sendSensors (  ) 

causes current sensor values to be sent through curSocket (along with video data)

Definition at line 57 of file CameraStreamBehavior.cc.

Referenced by processEvent(), and receiveData().

CameraStreamBehavior& CameraStreamBehavior::operator= ( const CameraStreamBehavior  )  [private]

don't call (assignment operator)


Member Data Documentation

the socket over which to send updates

Definition at line 39 of file CameraStreamBehavior.h.

Referenced by sendSensors().

unsigned int CameraStreamBehavior::sensorListeners [protected]

number of times startSensors has been sent, minus number of times stopSensors has been sent

Definition at line 42 of file CameraStreamBehavior.h.

Referenced by receiveData().

unsigned int CameraStreamBehavior::lastProcessedTime [protected]

timestamp of last sensor update sent

Reimplemented in RawCamBehavior, and SegCamBehavior.

Definition at line 45 of file CameraStreamBehavior.h.

Referenced by sendSensors().


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:12 2007 by Doxygen 1.5.4