Public Member Functions | Private Attributes | List of all members
multisense::legacy::MessageCondition Class Reference

A condition object which can be used to wait on messages from the stream. More...

#include <message.hh>

Public Member Functions

 MessageCondition ()=default
 
void set_and_notify (std::shared_ptr< std::vector< uint8_t >> data)
 
void unset ()
 
template<typename T >
std::optional< T > wait ()
 
template<typename T , class Rep , class Period >
std::optional< T > wait (const std::optional< std::chrono::duration< Rep, Period >> &timeout)
 convenience function equivalent to std::condition_variable::wait_for that performs a type conversion to the target type More...
 
 ~MessageCondition ()
 

Private Attributes

std::condition_variable m_cv
 
std::vector< uint8_t > m_data
 
std::mutex m_mutex
 
bool m_notified = false
 

Detailed Description

A condition object which can be used to wait on messages from the stream.

Definition at line 137 of file message.hh.

Constructor & Destructor Documentation

◆ MessageCondition()

multisense::legacy::MessageCondition::MessageCondition ( )
default

◆ ~MessageCondition()

multisense::legacy::MessageCondition::~MessageCondition ( )
inline

Definition at line 143 of file message.hh.

Member Function Documentation

◆ set_and_notify()

void multisense::legacy::MessageCondition::set_and_notify ( std::shared_ptr< std::vector< uint8_t >>  data)
inline

Definition at line 154 of file message.hh.

◆ unset()

void multisense::legacy::MessageCondition::unset ( )
inline

Definition at line 148 of file message.hh.

◆ wait() [1/2]

template<typename T >
std::optional<T> multisense::legacy::MessageCondition::wait ( )
inline

Definition at line 188 of file message.hh.

◆ wait() [2/2]

template<typename T , class Rep , class Period >
std::optional<T> multisense::legacy::MessageCondition::wait ( const std::optional< std::chrono::duration< Rep, Period >> &  timeout)
inline

convenience function equivalent to std::condition_variable::wait_for that performs a type conversion to the target type

Definition at line 167 of file message.hh.

Member Data Documentation

◆ m_cv

std::condition_variable multisense::legacy::MessageCondition::m_cv
private

Definition at line 197 of file message.hh.

◆ m_data

std::vector<uint8_t> multisense::legacy::MessageCondition::m_data
private

Definition at line 198 of file message.hh.

◆ m_mutex

std::mutex multisense::legacy::MessageCondition::m_mutex
private

Definition at line 196 of file message.hh.

◆ m_notified

bool multisense::legacy::MessageCondition::m_notified = false
private

Definition at line 199 of file message.hh.


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


multisense_lib
Author(s):
autogenerated on Thu Apr 17 2025 02:49:10