CARLA
Public Member Functions | Private Attributes | List of all members
carla::streaming::detail::MultiStreamState Class Referencefinal

A stream state that can hold any number of sessions. More...

#include <MultiStreamState.h>

+ Inheritance diagram for carla::streaming::detail::MultiStreamState:
+ Collaboration diagram for carla::streaming::detail::MultiStreamState:

Public Member Functions

bool AreClientsListening ()
 
void ClearSessions () final
 
void ConnectSession (std::shared_ptr< Session > session) final
 
void DisableForROS ()
 
void DisconnectSession (std::shared_ptr< Session > session) final
 
void EnableForROS ()
 
void ForceActive ()
 
bool IsEnabledForROS ()
 
 MultiStreamState (const token_type &token)
 
template<typename... Buffers>
void Write (Buffers... buffers)
 
- Public Member Functions inherited from carla::streaming::detail::StreamStateBase
Buffer MakeBuffer ()
 
 StreamStateBase (const token_type &token)
 
const token_typetoken () const
 
virtual ~StreamStateBase ()
 

Private Attributes

bool _enabled_for_ros {false}
 
bool _force_active {false}
 
std::mutex _mutex
 
AtomicSharedPtr< Session_session
 
std::vector< std::shared_ptr< Session > > _sessions
 

Detailed Description

A stream state that can hold any number of sessions.

Todo:
Lacking some optimization.

Definition at line 25 of file MultiStreamState.h.

Constructor & Destructor Documentation

◆ MultiStreamState()

carla::streaming::detail::MultiStreamState::MultiStreamState ( const token_type token)
inline

Definition at line 30 of file MultiStreamState.h.

Member Function Documentation

◆ AreClientsListening()

bool carla::streaming::detail::MultiStreamState::AreClientsListening ( )
inline

Definition at line 77 of file MultiStreamState.h.

References _enabled_for_ros, _force_active, and _sessions.

◆ ClearSessions()

void carla::streaming::detail::MultiStreamState::ClearSessions ( )
inlinefinalvirtual

Implements carla::streaming::detail::StreamStateBase.

Definition at line 119 of file MultiStreamState.h.

References _force_active, _mutex, _session, _sessions, and carla::log_debug().

+ Here is the call graph for this function:

◆ ConnectSession()

void carla::streaming::detail::MultiStreamState::ConnectSession ( std::shared_ptr< Session session)
inlinefinalvirtual

Implements carla::streaming::detail::StreamStateBase.

Definition at line 81 of file MultiStreamState.h.

References _mutex, _session, _sessions, DEBUG_ASSERT, and carla::log_debug().

+ Here is the call graph for this function:

◆ DisableForROS()

void carla::streaming::detail::MultiStreamState::DisableForROS ( )
inline

Definition at line 69 of file MultiStreamState.h.

References _enabled_for_ros.

◆ DisconnectSession()

void carla::streaming::detail::MultiStreamState::DisconnectSession ( std::shared_ptr< Session session)
inlinefinalvirtual

Implements carla::streaming::detail::StreamStateBase.

Definition at line 94 of file MultiStreamState.h.

References _force_active, _mutex, _session, _sessions, DEBUG_ASSERT, and carla::log_debug().

+ Here is the call graph for this function:

◆ EnableForROS()

void carla::streaming::detail::MultiStreamState::EnableForROS ( )
inline

Definition at line 65 of file MultiStreamState.h.

References _enabled_for_ros.

◆ ForceActive()

void carla::streaming::detail::MultiStreamState::ForceActive ( )
inline

Definition at line 61 of file MultiStreamState.h.

References _force_active.

◆ IsEnabledForROS()

bool carla::streaming::detail::MultiStreamState::IsEnabledForROS ( )
inline

Definition at line 73 of file MultiStreamState.h.

References _enabled_for_ros.

◆ Write()

template<typename... Buffers>
void carla::streaming::detail::MultiStreamState::Write ( Buffers...  buffers)
inline

Definition at line 36 of file MultiStreamState.h.

References _mutex, _session, _sessions, carla::log_debug(), and carla::streaming::detail::tcp::ServerSession::MakeMessage().

+ Here is the call graph for this function:

Member Data Documentation

◆ _enabled_for_ros

bool carla::streaming::detail::MultiStreamState::_enabled_for_ros {false}
private

◆ _force_active

bool carla::streaming::detail::MultiStreamState::_force_active {false}
private

◆ _mutex

std::mutex carla::streaming::detail::MultiStreamState::_mutex
private

Definition at line 134 of file MultiStreamState.h.

Referenced by ClearSessions(), ConnectSession(), DisconnectSession(), and Write().

◆ _session

AtomicSharedPtr<Session> carla::streaming::detail::MultiStreamState::_session
private

Definition at line 137 of file MultiStreamState.h.

Referenced by ClearSessions(), ConnectSession(), DisconnectSession(), and Write().

◆ _sessions

std::vector<std::shared_ptr<Session> > carla::streaming::detail::MultiStreamState::_sessions
private

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