#include <FsfCell.h>
Inherited by fsf::CNodeDelete, fsf::CPulsar, fsf::CSync, and fsf::CTypeCellBase.
Public Member Functions | |
Creators | |
CCell () | |
0-parameter constructor | |
virtual | ~CCell () |
Destructor. | |
Manipulators | |
void | setRepository (CRepository *pRepository) |
Sets repository pointer. | |
void | setActiveFilter (CActiveFilterBase *pFilter) |
Sets (replaces) active filter. | |
void | setPassiveFilter (CPassiveFilterBase *pFilter) |
Sets (replaces) passive filter. | |
void | setOutputName (const std::string &strOutputName) |
Sets output name string. | |
bool | connectDownstreamCell (CCell *pCell) |
Adds argument cell to this cell's list of downstream cells. | |
bool | disconnectDownstreamCell (CCell *pCell=NULL) |
Removes argument cell from this cell's list of downstream cells. | |
virtual bool | switchCell (bool bOn) |
Switches this cell on or off. | |
bool | on () |
Switches this cell on. | |
bool | off () |
Switches this cell off. | |
virtual void | setReset (bool b=true) |
Sets this cell's reset flag. | |
CActiveFilterBase * | cloneActiveFilter () |
Creates a clone of this cell's active filter. | |
CPassiveFilterBase * | clonePassiveFilter () |
Creates a clone of this cell's passive filter. | |
void | getOutputName (std::string &strOutputName) |
Gets output name string Should really be an accessor (const ). | |
Accessors | |
virtual void | getTypeID (std::string &str) const |
Returns factory mapping key. | |
CRepository * | getRepository () const |
Gets a pointer to this cell's repository. | |
CCell * | getUpstreamCell () const |
Gets a pointer to this cell's upstream cell. | |
bool | isActive () const |
Gets active status of this cell. | |
bool | doReset () const |
Gets reset status of this cell. | |
Connectivity | |
Functions to use when building a graph. | |
bool | connectRepository (fsf::CRepository *pRepository) |
Connects argument repository to this cell. | |
bool | disconnectRepository () |
Disconnects current repository from this cell. | |
bool | connectUpstreamCell (fsf::CCell *pUpstreamCell) |
connects this cell to argument upstream cell | |
bool | disconnectStream () |
disconnects this cell from stream (upstream cell and downstream cells) | |
Processing | |
virtual void | process (CPassiveHandle *pPassiveHandle, CActiveHandle *pActiveHandle, CActivePulse *pActivePulse) |
Custom processing place holder. | |
Protected Member Functions | |
Manipulators | |
Non thread safe protected access to private data member | |
void | lockOutputName () |
Locks output name mutex. | |
void | unlockOutputName () |
Unlocks output name mutex. | |
const std::string & | getOutputName () const |
Gets output name string. | |
void | setActive (bool bActive) |
Sets active boolean variable to specified value. | |
void | lockDownstream () |
Locks downstream cells mutex. | |
void | unlockDownstream () |
Unlocks downstream cells mutex. | |
std::list< CCell * > & | getListDownstream () |
Gets the list of downstream cells. | |
void | lockActiveFilter () |
Locks active filter mutex. | |
void | unlockActiveFilter () |
Unlocks active filter mutex. | |
CActiveFilterBase * | getActiveFilter () |
Gets a pointer to this cell's active filter. | |
void | lockPassiveFilter () |
Locks passive filter mutex. | |
void | unlockPassiveFilter () |
Unlocks passive filter mutex. | |
void | lockPassiveHandle () |
Locks passive handle mutex. | |
void | unlockPassiveHandle () |
Unlocks passive handle mutex. | |
CPassiveHandle * | getPassiveHandle () |
Gets a pointer to this cell's passive handle - can be NULL. | |
void | deletePassiveHandle () |
Deletes passive handle. | |
Multithreading | |
void | lockActiveThreads () |
Locks active threads condition variable. | |
void | unlockActiveThreads () |
Unlocks active threads condition variable. | |
void | waitActiveThreads () |
Waits on active threads condition variable. | |
void | broadcastActiveThreads () |
Broadcasts active threads condition variable. | |
void | lockPassiveThreads () |
Locks passive threads condition variable. | |
void | unlockPassiveThreads () |
Unlocks passive threads condition variable. | |
void | waitPassiveThreads () |
Waits on passive threads condition variable. | |
void | broadcastPassiveThreads () |
Broadcasts passive threads condition variable. | |
void | startActiveThread (CActivePulse *pPulse=NULL) |
Interface function for thread triggering. | |
virtual void | activeThread (CActivePulse *pPulse=NULL) |
Handles incoming active pulse. | |
void | startPassiveThread (CPassivePulse *pPulse=NULL) |
Interface function for thread triggering. | |
virtual bool | passiveThread (CPassivePulse *pPulse=NULL) |
Filters this cell's repository's (passive) pulse. | |
static void * | activeThreadProc (void *pParam) |
Thread entry function for active stream processing. | |
static void * | passiveThreadProc (void *pParam) |
Thread entry function for passive stream update. |
CCell::CCell | ( | ) |
0-parameter constructor
Sets default values for all fields.
CCell::~CCell | ( | ) | [virtual] |
Destructor.
Waits for all active and passive threads to finish.
Deletes passive filter, passive handle and active filter.
void CCell::activeThread | ( | CActivePulse * | pPulse = NULL |
) | [virtual] |
Handles incoming active pulse.
Calls process
if needed. If this function is called, the cell is active (checked in startActiveThread
) and pPulse is not null.
Reimplemented in fsf::CTypeCellBase.
void * fsf::CCell::activeThreadProc | ( | void * | pParam | ) | [inline, static] |
Thread entry function for active stream processing.
Calls activeThread
void fsf::CCell::broadcastActiveThreads | ( | ) | [inline] |
Broadcasts active threads condition variable.
void fsf::CCell::broadcastPassiveThreads | ( | ) | [inline] |
Broadcasts passive threads condition variable.
CActiveFilterBase * CCell::cloneActiveFilter | ( | ) |
Creates a clone of this cell's active filter.
CPassiveFilterBase * CCell::clonePassiveFilter | ( | ) |
Creates a clone of this cell's passive filter.
bool CCell::connectDownstreamCell | ( | CCell * | pCell | ) |
Adds argument cell to this cell's list of downstream cells.
bool CCell::connectRepository | ( | fsf::CRepository * | pRepository | ) |
Connects argument repository to this cell.
[in] | pRepository | the repository to be connected to this cell |
true
if cell is not already connected to a repository and was successfully connected to argument repository, false
otherwise. bool CCell::connectUpstreamCell | ( | fsf::CCell * | pUpstreamCell | ) |
connects this cell to argument upstream cell
[in] | pUpstreamCell | The upstream cell to which to connect this cell |
true
if this cell is not already connected to an upstream cell and if the connection to argument upstream cell was successful; false
otherwise. void fsf::CCell::deletePassiveHandle | ( | ) | [inline, protected] |
Deletes passive handle.
bool CCell::disconnectDownstreamCell | ( | CCell * | pCell = NULL |
) |
Removes argument cell from this cell's list of downstream cells.
bool CCell::disconnectRepository | ( | ) |
Disconnects current repository from this cell.
bool CCell::disconnectStream | ( | ) |
disconnects this cell from stream (upstream cell and downstream cells)
bool fsf::CCell::doReset | ( | ) | const [inline] |
Gets reset status of this cell.
CActiveFilterBase* fsf::CCell::getActiveFilter | ( | ) | [inline, protected] |
Gets a pointer to this cell's active filter.
std::list<CCell*>& fsf::CCell::getListDownstream | ( | ) | [inline, protected] |
Gets the list of downstream cells.
void fsf::CCell::getOutputName | ( | std::string & | strOutputName | ) | [inline] |
Gets output name string Should really be an accessor (const
).
const std::string& fsf::CCell::getOutputName | ( | ) | const [inline, protected] |
Gets output name string.
CPassiveHandle* fsf::CCell::getPassiveHandle | ( | ) | [inline, protected] |
Gets a pointer to this cell's passive handle - can be NULL.
CRepository* fsf::CCell::getRepository | ( | ) | const [inline] |
Gets a pointer to this cell's repository.
virtual void fsf::CCell::getTypeID | ( | std::string & | str | ) | const [inline, virtual] |
CCell* fsf::CCell::getUpstreamCell | ( | ) | const [inline] |
Gets a pointer to this cell's upstream cell.
bool fsf::CCell::isActive | ( | ) | const [inline] |
Gets active status of this cell.
void fsf::CCell::lockActiveFilter | ( | ) | [inline, protected] |
Locks active filter mutex.
void fsf::CCell::lockActiveThreads | ( | ) | [inline] |
Locks active threads condition variable.
void fsf::CCell::lockDownstream | ( | ) | [inline, protected] |
Locks downstream cells mutex.
void fsf::CCell::lockOutputName | ( | ) | [inline, protected] |
Locks output name mutex.
void fsf::CCell::lockPassiveFilter | ( | ) | [inline, protected] |
Locks passive filter mutex.
void fsf::CCell::lockPassiveHandle | ( | ) | [inline, protected] |
Locks passive handle mutex.
void fsf::CCell::lockPassiveThreads | ( | ) | [inline] |
Locks passive threads condition variable.
bool CCell::off | ( | ) |
Switches this cell off.
bool CCell::on | ( | ) |
Switches this cell on.
bool CCell::passiveThread | ( | CPassivePulse * | pPulse = NULL |
) | [virtual] |
Filters this cell's repository's (passive) pulse.
This function is triggered by passive stream update.
void * fsf::CCell::passiveThreadProc | ( | void * | pParam | ) | [inline, static] |
Thread entry function for passive stream update.
virtual void fsf::CCell::process | ( | CPassiveHandle * | pPassiveHandle, | |
CActiveHandle * | pActiveHandle, | |||
CActivePulse * | pActivePulse | |||
) | [inline, virtual] |
Custom processing place holder.
Reimplemented in fsf::CCharBufferSize, fsf::CNodeTimeStamp, fsf::CNodeName, fsf::CNodeTypeID, fsf::CNodeDelete, fsf::CTypeCell< Type >, and fsf::CTypeCellBase.
void fsf::CCell::setActive | ( | bool | bActive | ) | [inline, protected] |
Sets active boolean variable to specified value.
void CCell::setActiveFilter | ( | CActiveFilterBase * | pFilter | ) |
Sets (replaces) active filter.
Replaces this cell's active filter with the new one passed as argument.
Existing active filter, if any, is discarded.
void fsf::CCell::setOutputName | ( | const std::string & | strOutputName | ) | [inline] |
Sets output name string.
void CCell::setPassiveFilter | ( | CPassiveFilterBase * | pFilter | ) |
Sets (replaces) passive filter.
Replaces this cell's passive filter with the new one passed as argument.
Existing passive filter, if any, is discarded.
void fsf::CCell::setRepository | ( | CRepository * | pRepository | ) | [inline] |
Sets repository pointer.
virtual void fsf::CCell::setReset | ( | bool | b = true |
) | [inline, virtual] |
Sets this cell's reset flag.
void fsf::CCell::startActiveThread | ( | CActivePulse * | pPulse = NULL |
) | [inline] |
Interface function for thread triggering.
Starts a new thread whose entry point is activeThreadProc
Reimplemented in fsf::CTypeCellBase.
void fsf::CCell::startPassiveThread | ( | CPassivePulse * | pPulse = NULL |
) | [inline] |
Interface function for thread triggering.
Starts a new thread whose entry point is passiveThreadProc
bool CCell::switchCell | ( | bool | bOn | ) | [virtual] |
void fsf::CCell::unlockActiveFilter | ( | ) | [inline, protected] |
Unlocks active filter mutex.
void fsf::CCell::unlockActiveThreads | ( | ) | [inline] |
Unlocks active threads condition variable.
void fsf::CCell::unlockDownstream | ( | ) | [inline, protected] |
Unlocks downstream cells mutex.
void fsf::CCell::unlockOutputName | ( | ) | [inline, protected] |
Unlocks output name mutex.
void fsf::CCell::unlockPassiveFilter | ( | ) | [inline, protected] |
Unlocks passive filter mutex.
void fsf::CCell::unlockPassiveHandle | ( | ) | [inline, protected] |
Unlocks passive handle mutex.
void fsf::CCell::unlockPassiveThreads | ( | ) | [inline] |
Unlocks passive threads condition variable.
void fsf::CCell::waitActiveThreads | ( | ) | [inline] |
Waits on active threads condition variable.
void fsf::CCell::waitPassiveThreads | ( | ) | [inline] |
Waits on passive threads condition variable.