Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BufferSource Class Reference

description of BufferSource More...

#include <BufferSource.h>

Inheritance diagram for BufferSource:

Detailed Description

description of BufferSource

Definition at line 11 of file BufferSource.h.

List of all members.

Public Member Functions

 BufferSource ()
 constructor
virtual unsigned int nextTimestamp ()
 Returns the simulator time of the next data segment.
virtual const std::string & nextName ()
 Returns a descriptive name of the next data segment for user feedback (e.g. a filename for logged data).
virtual unsigned int getData (const char *&payload, unsigned int &payloadSize, unsigned int &t, std::string &n)
virtual void signalReady ()
 swaps timestamp, name, and buffer with their "ready" counterparts
virtual void setDataSourceThread (LoadDataThread *th)

Public Attributes

unsigned int timestamp
 value to return as timestamp of buffer (or nextTimestamp())
std::string name
 value to return as name of buffer (or nextName())
std::vector< char > buffer
 pointer to buffer for writing
unsigned int reqTime
 requested timestamp by last call to getData(), or -1U if not called or no LoadDataThread registered

Protected Attributes

Thread::Lock swapLock
 lock while swapping during signalReady()
Thread::Condition readySignal
 used to wake up sleeping thread in getData()
unsigned int readyTimestamp
 the timestamp to report for readyBuffer in getData()
std::string readyName
 the name to report for readyBuffer in getData()
std::vector< char > readyBuffer
 the payload data to return in getData()
bool isReady
 set to true when signalReady() is called, cleared by getData()
unsigned int frame
 incremented for each call to signalReady();

Constructor & Destructor Documentation

BufferSource (  ) 

constructor

Definition at line 14 of file BufferSource.h.


Member Function Documentation

virtual unsigned int getData ( const char *&  payload,
unsigned int &  payloadSize,
unsigned int &  t,
std::string &  n 
) [virtual]
virtual const std::string& nextName (  )  [virtual]

Returns a descriptive name of the next data segment for user feedback (e.g. a filename for logged data).

Just use your class name if you don't have a useful name for individual samples.

Implements DataSource.

Definition at line 26 of file BufferSource.h.

virtual unsigned int nextTimestamp (  )  [virtual]

Returns the simulator time of the next data segment.

Should be in the future if nothing new since last data segment, otherwise should be the timestamp of the most recent data segment (older segments are skipped), return -1U if there is no more data

Implements DataSource.

Definition at line 25 of file BufferSource.h.

virtual void setDataSourceThread ( LoadDataThread *  th  )  [virtual]

Definition at line 31 of file BufferSource.h.

virtual void signalReady (  )  [virtual]

swaps timestamp, name, and buffer with their "ready" counterparts


Member Data Documentation

std::vector<char> buffer

pointer to buffer for writing

Definition at line 22 of file BufferSource.h.

unsigned int frame [protected]

incremented for each call to signalReady();

Definition at line 44 of file BufferSource.h.

bool isReady [protected]

set to true when signalReady() is called, cleared by getData()

Definition at line 43 of file BufferSource.h.

std::string name

value to return as name of buffer (or nextName())

Definition at line 21 of file BufferSource.h.

Referenced by nextName().

std::vector<char> readyBuffer [protected]

the payload data to return in getData()

Definition at line 42 of file BufferSource.h.

std::string readyName [protected]

the name to report for readyBuffer in getData()

Definition at line 41 of file BufferSource.h.

used to wake up sleeping thread in getData()

Definition at line 39 of file BufferSource.h.

unsigned int readyTimestamp [protected]

the timestamp to report for readyBuffer in getData()

Definition at line 40 of file BufferSource.h.

unsigned int reqTime

requested timestamp by last call to getData(), or -1U if not called or no LoadDataThread registered

Definition at line 23 of file BufferSource.h.

Referenced by setDataSourceThread().

Thread::Lock swapLock [protected]

lock while swapping during signalReady()

Definition at line 38 of file BufferSource.h.

unsigned int timestamp

value to return as timestamp of buffer (or nextTimestamp())

Definition at line 20 of file BufferSource.h.

Referenced by nextTimestamp().


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

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:40 2016 by Doxygen 1.6.3