CARLA
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
carla::streaming::detail::Stream< StreamStateT > Class Template Reference

#include <Stream.h>

+ Collaboration diagram for carla::streaming::detail::Stream< StreamStateT >:

Public Member Functions

bool AreClientsListening ()
 
Buffer MakeBuffer ()
 Pull a buffer from the buffer pool associated to this stream. More...
 
template<typename T >
Streamoperator<< (const T &data)
 Make a copy of data and flush it down the stream. More...
 
Streamoperator= (const Stream &)=default
 
Streamoperator= (Stream &&)=default
 
 Stream ()=delete
 
 Stream (const Stream &)=default
 
 Stream (Stream &&)=default
 
Token token () const
 Token associated with this stream. More...
 
template<typename... Buffers>
void Write (Buffers &&... buffers)
 Flush buffers down the stream. No copies are made. More...
 

Private Member Functions

 Stream (std::shared_ptr< StreamStateT > state)
 

Private Attributes

std::shared_ptr< StreamStateT > _shared_state
 

Friends

class detail::Dispatcher
 

Detailed Description

template<typename StreamStateT>
class carla::streaming::detail::Stream< StreamStateT >

Definition at line 22 of file detail/Stream.h.

Constructor & Destructor Documentation

◆ Stream() [1/4]

template<typename StreamStateT >
carla::streaming::detail::Stream< StreamStateT >::Stream ( )
delete

◆ Stream() [2/4]

template<typename StreamStateT >
carla::streaming::detail::Stream< StreamStateT >::Stream ( const Stream< StreamStateT > &  )
default

◆ Stream() [3/4]

template<typename StreamStateT >
carla::streaming::detail::Stream< StreamStateT >::Stream ( Stream< StreamStateT > &&  )
default

◆ Stream() [4/4]

template<typename StreamStateT >
carla::streaming::detail::Stream< StreamStateT >::Stream ( std::shared_ptr< StreamStateT >  state)
inlineprivate

Member Function Documentation

◆ AreClientsListening()

template<typename StreamStateT >
bool carla::streaming::detail::Stream< StreamStateT >::AreClientsListening ( )
inline

◆ MakeBuffer()

template<typename StreamStateT >
Buffer carla::streaming::detail::Stream< StreamStateT >::MakeBuffer ( )
inline

Pull a buffer from the buffer pool associated to this stream.

Discarded buffers are re-used to avoid memory allocations.

Note
Re-using buffers is optimized for the use case in which all the messages sent through the stream are big and have (approximately) the same size.

Definition at line 45 of file detail/Stream.h.

References carla::streaming::detail::Stream< StreamStateT >::_shared_state.

Referenced by carla::streaming::detail::Stream< StreamStateT >::operator<<().

+ Here is the caller graph for this function:

◆ operator<<()

template<typename StreamStateT >
template<typename T >
Stream& carla::streaming::detail::Stream< StreamStateT >::operator<< ( const T &  data)
inline

Make a copy of data and flush it down the stream.

Definition at line 58 of file detail/Stream.h.

References carla::streaming::detail::Stream< StreamStateT >::MakeBuffer(), and carla::streaming::detail::Stream< StreamStateT >::Write().

+ Here is the call graph for this function:

◆ operator=() [1/2]

template<typename StreamStateT >
Stream& carla::streaming::detail::Stream< StreamStateT >::operator= ( const Stream< StreamStateT > &  )
default

◆ operator=() [2/2]

template<typename StreamStateT >
Stream& carla::streaming::detail::Stream< StreamStateT >::operator= ( Stream< StreamStateT > &&  )
default

◆ token()

template<typename StreamStateT >
Token carla::streaming::detail::Stream< StreamStateT >::token ( ) const
inline

Token associated with this stream.

This token can be used by a client to subscribe to this stream.

Definition at line 35 of file detail/Stream.h.

References carla::streaming::detail::Stream< StreamStateT >::_shared_state.

Referenced by Benchmark::AddStream(), and FCarlaServer::FPimpl::BindActions().

+ Here is the caller graph for this function:

◆ Write()

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

Flush buffers down the stream. No copies are made.

Definition at line 52 of file detail/Stream.h.

References carla::streaming::detail::Stream< StreamStateT >::_shared_state.

Referenced by carla::streaming::detail::Stream< StreamStateT >::operator<<().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ detail::Dispatcher

template<typename StreamStateT >
friend class detail::Dispatcher
friend

Definition at line 72 of file detail/Stream.h.

Member Data Documentation

◆ _shared_state

template<typename StreamStateT >
std::shared_ptr<StreamStateT> carla::streaming::detail::Stream< StreamStateT >::_shared_state
private

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