SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS > Class Template Reference

#include <c++/drivers/base/src/SickBufferMonitor.hh>

Inheritance diagram for SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >:

Inheritance graph
[legend]
Collaboration diagram for SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SickBufferMonitor (SICK_MONITOR_CLASS *const monitor_instance) throw ( SickThreadException )
 Primary constructor.
void SetDataStream (const unsigned int sick_fd) throw ( SickThreadException )
 A method for setting/changing the current data stream.
void StartMonitor (const unsigned int sick_fd) throw ( SickThreadException )
 Creates and starts the buffer monitor thread.
bool GetNextMessageFromMonitor (SICK_MSG_CLASS &sick_message) throw ( SickThreadException )
 Checks the message container for the next available Sick message.
void StopMonitor () throw ( SickThreadException )
 Cancels the buffer monitor thread.
void AcquireDataStream () throw ( SickThreadException )
 Acquires a lock on the data stream.
void GetNextMessageFromDataStream (SICK_MSG_CLASS &sick_message)
void ReleaseDataStream () throw ( SickThreadException )
 Releases a lock on the data stream.
 ~SickBufferMonitor () throw ( SickThreadException )
 The destructor (kills the mutex).

Protected Member Functions

void _readBytes (uint8_t *const dest_buffer, const int num_bytes_to_read, const unsigned int timeout_value=0) const throw ( SickTimeoutException, SickIOException )
 Attempt to read a certain number of bytes from the stream.

Protected Attributes

unsigned int _sick_fd

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
class SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >


Constructor & Destructor Documentation

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::SickBufferMonitor ( SICK_MONITOR_CLASS *const   monitor_instance  )  throw ( SickThreadException )

Primary constructor.

A standard constructor

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::~SickBufferMonitor (  )  throw ( SickThreadException )

The destructor (kills the mutex).

A standard destructor


Member Function Documentation

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::SetDataStream ( const unsigned int  sick_fd  )  throw ( SickThreadException )

A method for setting/changing the current data stream.

A method for setting the target data stream

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::StartMonitor ( const unsigned int  sick_fd  )  throw ( SickThreadException )

Creates and starts the buffer monitor thread.

Start the buffer monitor for the device

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
bool SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::GetNextMessageFromMonitor ( SICK_MSG_CLASS &  sick_message  )  throw ( SickThreadException )

Checks the message container for the next available Sick message.

Acquire the most recent message buffered by the monitor

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::StopMonitor (  )  throw ( SickThreadException )

Cancels the buffer monitor thread.

Stop the buffer monitor for the device

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::AcquireDataStream (  )  throw ( SickThreadException )

Acquires a lock on the data stream.

Locks access to the data stream

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::GetNextMessageFromDataStream ( SICK_MSG_CLASS &  sick_message  ) 

Acquire the next message from raw byte stream

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::ReleaseDataStream (  )  throw ( SickThreadException )

Releases a lock on the data stream.

Unlock access to the data stream

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
void SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_readBytes ( uint8_t *const  dest_buffer,
const int  num_bytes_to_read,
const unsigned int  timeout_value = 0 
) const throw ( SickTimeoutException, SickIOException ) [protected]

Attempt to read a certain number of bytes from the stream.

Reads n bytes into the destination buffer


Member Data Documentation

template<class SICK_MONITOR_CLASS, class SICK_MSG_CLASS>
unsigned int SickToolbox::SickBufferMonitor< SICK_MONITOR_CLASS, SICK_MSG_CLASS >::_sick_fd [protected]

Sick data stream file descriptor


The documentation for this class was generated from the following file:
Generated on Thu Mar 20 09:41:45 2008 for sicktoolbox-1.0 by  doxygen 1.5.1