Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

RegionCamBehavior Class Reference

#include <RegionCamBehavior.h>

Inheritance diagram for RegionCamBehavior:

List of all members.


Detailed Description

Forwards segmented images from camera over wireless.

Definition at line 14 of file RegionCamBehavior.h.


Public Member Functions

 RegionCamBehavior ()
 constructor
virtual void DoStart ()
 By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.
virtual void DoStop ()
 By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).
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).

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).

Static Public Attributes

static const unsigned int TCP_WIRELESS_BUFFER_SIZE = 85000
 85000 bytes for use up to 416x320 pixels / 8 min expected runs * 5 bytes per run + some padding
static const unsigned int UDP_WIRELESS_BUFFER_SIZE = 64*1024
 64KB is the max udp packet size

Protected Member Functions

void closeServer ()
 tear down the server socket (visRegion)
void setupServer ()
 setup the server socket (visRegion)
bool openPacket (FilterBankGenerator &fbkgen, unsigned int time, unsigned int layer)
 opens a new packet, writes header info; returns true if open, false if otherwise open (check cur==NULL for error)
bool writeRegions (const FilterBankEvent &fbke)
 writes the region information
void closePacket ()
 closes and sends a packet, does nothing if no packet open

Protected Attributes

SocketvisRegion
 socket to send image stream over
char * packet
 buffer being filled out to be sent
char * cur
 current location in packet
unsigned int avail
 number of bytes remaining in packet
unsigned int max_buf
 the buffer size requested from Wireless when the socket was allocated

Private Member Functions

 RegionCamBehavior (const RegionCamBehavior &)
 don't call
RegionCamBehavioroperator= (const RegionCamBehavior &)
 don't call

Constructor & Destructor Documentation

RegionCamBehavior::RegionCamBehavior (  ) 

constructor

Definition at line 10 of file RegionCamBehavior.cc.

RegionCamBehavior::RegionCamBehavior ( const RegionCamBehavior  )  [private]

don't call


Member Function Documentation

void RegionCamBehavior::DoStart (  )  [virtual]

By default, merely adds to the reference counter (through AddReference()); Note you should still call this from your overriding methods.

Reimplemented from BehaviorBase.

Definition at line 16 of file RegionCamBehavior.cc.

void RegionCamBehavior::DoStop (  )  [virtual]

By default, subtracts from the reference counter (RemoveReference()), and thus may deletex if zero; Don't forget to still call this when you override this; Warning: call this at the end of your DoStop(), not beginning (it might delete this ).

Reimplemented from BehaviorBase.

Definition at line 23 of file RegionCamBehavior.cc.

void RegionCamBehavior::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.

Definition at line 30 of file RegionCamBehavior.cc.

static std::string RegionCamBehavior::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.

Definition at line 28 of file RegionCamBehavior.h.

Referenced by getDescription().

virtual std::string RegionCamBehavior::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.

Definition at line 33 of file RegionCamBehavior.h.

void RegionCamBehavior::closeServer (  )  [protected]

tear down the server socket (visRegion)

Definition at line 49 of file RegionCamBehavior.cc.

Referenced by DoStop(), and processEvent().

void RegionCamBehavior::setupServer (  )  [protected]

setup the server socket (visRegion)

Definition at line 59 of file RegionCamBehavior.cc.

Referenced by DoStart(), and processEvent().

bool RegionCamBehavior::openPacket ( FilterBankGenerator fbkgen,
unsigned int  time,
unsigned int  layer 
) [protected]

opens a new packet, writes header info; returns true if open, false if otherwise open (check cur==NULL for error)

see the class documentation for RegionCamBehavior for the protocol documentation

Definition at line 83 of file RegionCamBehavior.cc.

Referenced by writeRegions().

bool RegionCamBehavior::writeRegions ( const FilterBankEvent fbke  )  [protected]

writes the region information

Definition at line 109 of file RegionCamBehavior.cc.

Referenced by processEvent().

void RegionCamBehavior::closePacket (  )  [protected]

closes and sends a packet, does nothing if no packet open

Definition at line 133 of file RegionCamBehavior.cc.

Referenced by writeRegions().

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

don't call


Member Data Documentation

const unsigned int RegionCamBehavior::TCP_WIRELESS_BUFFER_SIZE = 85000 [static]

85000 bytes for use up to 416x320 pixels / 8 min expected runs * 5 bytes per run + some padding

Definition at line 19 of file RegionCamBehavior.h.

Referenced by setupServer().

const unsigned int RegionCamBehavior::UDP_WIRELESS_BUFFER_SIZE = 64*1024 [static]

64KB is the max udp packet size

Definition at line 20 of file RegionCamBehavior.h.

Referenced by setupServer().

socket to send image stream over

Definition at line 45 of file RegionCamBehavior.h.

Referenced by closePacket(), closeServer(), openPacket(), processEvent(), and setupServer().

char* RegionCamBehavior::packet [protected]

buffer being filled out to be sent

Definition at line 46 of file RegionCamBehavior.h.

Referenced by closePacket(), and openPacket().

char* RegionCamBehavior::cur [protected]

current location in packet

Definition at line 47 of file RegionCamBehavior.h.

Referenced by closePacket(), openPacket(), and writeRegions().

unsigned int RegionCamBehavior::avail [protected]

number of bytes remaining in packet

Definition at line 48 of file RegionCamBehavior.h.

Referenced by closePacket(), openPacket(), and writeRegions().

unsigned int RegionCamBehavior::max_buf [protected]

the buffer size requested from Wireless when the socket was allocated

Definition at line 49 of file RegionCamBehavior.h.

Referenced by openPacket(), and setupServer().


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

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