Public Member Functions | Private Types | Private Member Functions | Private Attributes
pcl::Synchronizer< T1, T2 > Class Template Reference

#include <synchronizer.h>

List of all members.

Public Member Functions

void add0 (const T1 &t, unsigned long time)
void add1 (const T2 &t, unsigned long time)
int addCallback (const CallbackFunction &callback)
void removeCallback (int i)
 Synchronizer ()

Private Types

typedef boost::function< void(T1,
T2, unsigned long, unsigned
long) > 
CallbackFunction
typedef std::pair< unsigned
long, T1 > 
T1Stamped
typedef std::pair< unsigned
long, T2 > 
T2Stamped

Private Member Functions

void publish ()
void publishData ()

Private Attributes

int callback_counter
std::map< int, CallbackFunctioncb_
boost::mutex mutex1_
boost::mutex mutex2_
boost::mutex publish_mutex_
std::deque< T1StampedqueueT1
std::deque< T2StampedqueueT2

Detailed Description

template<typename T1, typename T2>
class pcl::Synchronizer< T1, T2 >

/brief This template class synchronizes two data streams of different types. The data can be added using add0 and add1 methods which expects also a timestamp of type unsigned long. If two matching data objects are found, registered callback functions are invoked with the objects and the time stamps. The only assumption of the timestamp is, that they are in the same unit, linear and strictly monotonic increasing. If filtering is desired, e.g. thresholding of time differences, the user can do that in the callback method. This class is thread safe. /ingroup common

Definition at line 49 of file synchronizer.h.


Member Typedef Documentation

template<typename T1 , typename T2 >
typedef boost::function<void(T1, T2, unsigned long, unsigned long) > pcl::Synchronizer< T1, T2 >::CallbackFunction [private]

Definition at line 59 of file synchronizer.h.

template<typename T1 , typename T2 >
typedef std::pair<unsigned long, T1> pcl::Synchronizer< T1, T2 >::T1Stamped [private]

Definition at line 51 of file synchronizer.h.

template<typename T1 , typename T2 >
typedef std::pair<unsigned long, T2> pcl::Synchronizer< T1, T2 >::T2Stamped [private]

Definition at line 52 of file synchronizer.h.


Constructor & Destructor Documentation

template<typename T1 , typename T2 >
pcl::Synchronizer< T1, T2 >::Synchronizer ( ) [inline]

Definition at line 65 of file synchronizer.h.


Member Function Documentation

template<typename T1 , typename T2 >
void pcl::Synchronizer< T1, T2 >::add0 ( const T1 &  t,
unsigned long  time 
) [inline]

Definition at line 83 of file synchronizer.h.

template<typename T1 , typename T2 >
void pcl::Synchronizer< T1, T2 >::add1 ( const T2 &  t,
unsigned long  time 
) [inline]

Definition at line 92 of file synchronizer.h.

template<typename T1 , typename T2 >
int pcl::Synchronizer< T1, T2 >::addCallback ( const CallbackFunction callback) [inline]

Definition at line 68 of file synchronizer.h.

template<typename T1 , typename T2 >
void pcl::Synchronizer< T1, T2 >::publish ( ) [inline, private]

Definition at line 121 of file synchronizer.h.

template<typename T1 , typename T2 >
void pcl::Synchronizer< T1, T2 >::publishData ( ) [inline, private]

Definition at line 103 of file synchronizer.h.

template<typename T1 , typename T2 >
void pcl::Synchronizer< T1, T2 >::removeCallback ( int  i) [inline]

Definition at line 76 of file synchronizer.h.


Member Data Documentation

template<typename T1 , typename T2 >
int pcl::Synchronizer< T1, T2 >::callback_counter [private]

Definition at line 62 of file synchronizer.h.

template<typename T1 , typename T2 >
std::map<int, CallbackFunction> pcl::Synchronizer< T1, T2 >::cb_ [private]

Definition at line 61 of file synchronizer.h.

template<typename T1 , typename T2 >
boost::mutex pcl::Synchronizer< T1, T2 >::mutex1_ [private]

Definition at line 53 of file synchronizer.h.

template<typename T1 , typename T2 >
boost::mutex pcl::Synchronizer< T1, T2 >::mutex2_ [private]

Definition at line 54 of file synchronizer.h.

template<typename T1 , typename T2 >
boost::mutex pcl::Synchronizer< T1, T2 >::publish_mutex_ [private]

Definition at line 55 of file synchronizer.h.

template<typename T1 , typename T2 >
std::deque<T1Stamped> pcl::Synchronizer< T1, T2 >::queueT1 [private]

Definition at line 56 of file synchronizer.h.

template<typename T1 , typename T2 >
std::deque<T2Stamped> pcl::Synchronizer< T1, T2 >::queueT2 [private]

Definition at line 57 of file synchronizer.h.


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


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:20:17