CARLA
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
carla::streaming::detail::token_type Class Reference

Serializes a stream endpoint. More...

#include <Token.h>

+ Collaboration diagram for carla::streaming::detail::token_type:

Public Member Functions

bool address_is_v4 () const
 
bool address_is_v6 () const
 
boost::asio::ip::address get_address () const
 
auto get_port () const
 
const auto & get_stream_id () const
 
bool has_address () const
 
template<typename Protocol >
bool has_same_protocol (const boost::asio::ip::basic_endpoint< Protocol > &) const
 
bool is_valid () const
 
 operator Token () const
 
bool protocol_is_tcp () const
 
bool protocol_is_udp () const
 
void set_address (const boost::asio::ip::address &addr)
 
void set_stream_id (stream_id_type id)
 
boost::asio::ip::tcp::endpoint to_tcp_endpoint () const
 
boost::asio::ip::udp::endpoint to_udp_endpoint () const
 
template<typename Protocol >
 token_type (stream_id_type stream_id, const EndPoint< Protocol, FullyDefinedEndPoint > &ep)
 
template<typename Protocol >
 token_type (stream_id_type stream_id, EndPoint< Protocol, PartiallyDefinedEndPoint > ep)
 
 token_type ()=default
 
 token_type (const token_type &)=default
 
 token_type (const Token &rhs)
 
 token_type (token_data data)
 

Private Member Functions

template<typename P >
boost::asio::ip::basic_endpoint< P > get_endpoint () const
 

Static Private Member Functions

template<typename P >
static constexpr auto get_protocol ()
 

Private Attributes

token_data _token
 

Friends

class Dispatcher
 

Detailed Description

Serializes a stream endpoint.

Contains all the necessary information for a client to subscribe to a stream.

Definition at line 61 of file detail/Token.h.

Constructor & Destructor Documentation

◆ token_type() [1/6]

template<typename Protocol >
carla::streaming::detail::token_type::token_type ( stream_id_type  stream_id,
const EndPoint< Protocol, FullyDefinedEndPoint > &  ep 
)
inlineexplicit

Definition at line 84 of file detail/Token.h.

References carla::streaming::detail::EndPoint< Protocol, FullyDefinedEndPoint >::address(), carla::streaming::detail::EndPoint< Protocol, FullyDefinedEndPoint >::port(), and carla::streaming::detail::token_data::stream_id.

+ Here is the call graph for this function:

◆ token_type() [2/6]

template<typename Protocol >
carla::streaming::detail::token_type::token_type ( stream_id_type  stream_id,
EndPoint< Protocol, PartiallyDefinedEndPoint ep 
)
inlineexplicit

Definition at line 94 of file detail/Token.h.

References carla::streaming::detail::EndPoint< Protocol, PartiallyDefinedEndPoint >::port(), and carla::streaming::detail::token_data::stream_id.

+ Here is the call graph for this function:

◆ token_type() [3/6]

carla::streaming::detail::token_type::token_type ( )
default

◆ token_type() [4/6]

carla::streaming::detail::token_type::token_type ( const token_type )
default

◆ token_type() [5/6]

carla::streaming::detail::token_type::token_type ( const Token rhs)

Definition at line 30 of file Token.cpp.

References _token, and carla::streaming::Token::data.

◆ token_type() [6/6]

carla::streaming::detail::token_type::token_type ( token_data  data)
inlineexplicit

Definition at line 108 of file detail/Token.h.

Member Function Documentation

◆ address_is_v4()

bool carla::streaming::detail::token_type::address_is_v4 ( ) const
inline

Definition at line 142 of file detail/Token.h.

References carla::streaming::detail::token_data::ip_v4.

◆ address_is_v6()

bool carla::streaming::detail::token_type::address_is_v6 ( ) const
inline

Definition at line 146 of file detail/Token.h.

References carla::streaming::detail::token_data::ip_v6.

◆ get_address()

boost::asio::ip::address carla::streaming::detail::token_type::get_address ( ) const

◆ get_endpoint()

template<typename P >
boost::asio::ip::basic_endpoint<P> carla::streaming::detail::token_type::get_endpoint ( ) const
inlineprivate

Definition at line 75 of file detail/Token.h.

References DEBUG_ASSERT.

◆ get_port()

auto carla::streaming::detail::token_type::get_port ( ) const
inline

Definition at line 132 of file detail/Token.h.

Referenced by carla::streaming::detail::Dispatcher::GetToken(), and carla::multigpu::PrimaryCommands::SendGetToken().

+ Here is the caller graph for this function:

◆ get_protocol()

template<typename P >
static constexpr auto carla::streaming::detail::token_type::get_protocol ( )
inlinestaticprivate

◆ get_stream_id()

const auto& carla::streaming::detail::token_type::get_stream_id ( ) const
inline

◆ has_address()

bool carla::streaming::detail::token_type::has_address ( ) const
inline

Definition at line 124 of file detail/Token.h.

References carla::streaming::detail::token_data::not_set.

Referenced by carla::streaming::low_level::Client< detail::tcp::Client >::Subscribe().

+ Here is the caller graph for this function:

◆ has_same_protocol()

template<typename Protocol >
bool carla::streaming::detail::token_type::has_same_protocol ( const boost::asio::ip::basic_endpoint< Protocol > &  ) const
inline

Definition at line 159 of file detail/Token.h.

◆ is_valid()

bool carla::streaming::detail::token_type::is_valid ( ) const
inline

Definition at line 136 of file detail/Token.h.

References carla::streaming::detail::token_data::not_set.

Referenced by carla::streaming::detail::tcp::Client::Connect().

+ Here is the caller graph for this function:

◆ operator Token()

carla::streaming::detail::token_type::operator Token ( ) const

Definition at line 34 of file Token.cpp.

References _token, and carla::streaming::Token::data.

◆ protocol_is_tcp()

bool carla::streaming::detail::token_type::protocol_is_tcp ( ) const
inline

Definition at line 154 of file detail/Token.h.

References carla::streaming::detail::token_data::tcp.

Referenced by carla::streaming::detail::tcp::Client::Client(), and carla::streaming::detail::tcp::Client::Connect().

+ Here is the caller graph for this function:

◆ protocol_is_udp()

bool carla::streaming::detail::token_type::protocol_is_udp ( ) const
inline

Definition at line 150 of file detail/Token.h.

References carla::streaming::detail::token_data::udp.

◆ set_address()

void carla::streaming::detail::token_type::set_address ( const boost::asio::ip::address &  addr)

Definition at line 18 of file Token.cpp.

References _token, carla::streaming::detail::token_data::address_type, carla::streaming::detail::token_data::ip_v4, carla::streaming::detail::token_data::ip_v6, and carla::throw_exception().

Referenced by carla::streaming::low_level::Client< detail::tcp::Client >::Subscribe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_stream_id()

void carla::streaming::detail::token_type::set_stream_id ( stream_id_type  id)
inline

Definition at line 120 of file detail/Token.h.

Referenced by carla::streaming::detail::Dispatcher::GetToken().

+ Here is the caller graph for this function:

◆ to_tcp_endpoint()

boost::asio::ip::tcp::endpoint carla::streaming::detail::token_type::to_tcp_endpoint ( ) const
inline

Definition at line 167 of file detail/Token.h.

Referenced by carla::streaming::detail::tcp::Client::Connect().

+ Here is the caller graph for this function:

◆ to_udp_endpoint()

boost::asio::ip::udp::endpoint carla::streaming::detail::token_type::to_udp_endpoint ( ) const
inline

Definition at line 163 of file detail/Token.h.

Friends And Related Function Documentation

◆ Dispatcher

friend class Dispatcher
friend

Definition at line 173 of file detail/Token.h.

Member Data Documentation

◆ _token

token_data carla::streaming::detail::token_type::_token
private

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