libcaf  0.15.5
Public Member Functions | List of all members
caf::empty_type_erased_tuple Class Reference

#include <type_erased_tuple.hpp>

Inheritance diagram for caf::empty_type_erased_tuple:
caf::type_erased_tuple

Public Member Functions

void * get_mutable (size_t pos) override
 Returns a mutable pointer to the element at position pos.
 
error load (size_t pos, deserializer &source) override
 Load the content for the element at position pos from source.
 
size_t size () const noexcept override
 Returns the size of this tuple.
 
uint32_t type_token () const noexcept override
 Returns a type hint for the element types.
 
rtti_pair type (size_t pos) const noexcept override
 Returns the type number and std::type_info object for the element at position pos. More...
 
const void * get (size_t pos) const noexcept override
 Returns the element at position pos.
 
std::string stringify (size_t pos) const override
 Returns a string representation of the element at position pos.
 
type_erased_value_ptr copy (size_t pos) const override
 Returns a copy of the element at position pos.
 
error save (size_t pos, serializer &sink) const override
 Saves the element at position pos to sink.
 
- Public Member Functions inherited from caf::type_erased_tuple
 type_erased_tuple (const type_erased_tuple &)=default
 
error load (deserializer &source)
 Load the content for the tuple from source.
 
virtual bool shared () const noexcept
 Returns whether multiple references to this tuple exist. More...
 
bool empty () const
 Returns size() == 0.
 
std::string stringify () const
 Returns a string representation of the tuple.
 
error save (serializer &sink) const
 Saves the content of the tuple to sink.
 
bool matches (size_t pos, uint16_t nr, const std::type_info *ptr) const noexcept
 Checks whether the type of the stored value at position pos matches type number n and run-time type information p. More...
 
uint16_t type_nr (size_t pos) const noexcept
 Returns the type number for the element at position pos.
 
bool matches (size_t pos, const rtti_pair &rtti) const noexcept
 Checks whether the type of the stored value matches rtti.
 
template<class T >
const T & get_as (size_t pos) const
 Convenience function for *reinterpret_cast<const T*>(get()).
 
template<class T , size_t Pos>
const T & get_as (typed_index< T, Pos >) const
 
template<class... Ts, long... Is>
std::tuple< const Ts &... > get_as_tuple (detail::type_list< Ts... >, detail::int_list< Is... >) const
 
template<class... Ts>
std::tuple< const Ts &... > get_as_tuple () const
 
template<class T >
T & get_mutable_as (size_t pos)
 Convenience function for *reinterpret_cast<T*>(get_mutable()).
 
template<class T >
move_if_unshared (size_t pos)
 Convenience function for moving a value out of the tuple if it is unshared. More...
 
template<class T >
bool match_element (size_t pos) const noexcept
 Returns true if the element at pos matches T.
 
template<class... Ts>
bool match_elements () const noexcept
 Returns true if the pattern Ts... matches the content of this tuple.
 
template<class F >
auto apply (F fun) -> optional< typename detail::get_callable_trait< F >::result_type >
 

Additional Inherited Members

- Public Types inherited from caf::type_erased_tuple
using rtti_pair = std::pair< uint16_t, const std::type_info * >
 
- Static Public Member Functions inherited from caf::type_erased_tuple
template<class T , size_t Pos>
static constexpr typed_index< T, Pos > make_typed_index ()
 

Detailed Description

Dummy objects representing empty tuples.

Member Function Documentation

rtti_pair caf::empty_type_erased_tuple::type ( size_t  pos) const
overridevirtualnoexcept

Returns the type number and std::type_info object for the element at position pos.

Implements caf::type_erased_tuple.


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