C++ Actor Framework  0.18
Public Member Functions | Related Functions | List of all members
caf::type_erased_value Class Referenceabstract

Represents a single type-erased value. More...

#include <type_erased_value.hpp>

Collaboration diagram for caf::type_erased_value:
Collaboration graph

Public Member Functions

virtual void * get_mutable ()=0
 Returns a mutable pointer to the stored value.
 
virtual error load (deserializer &source)=0
 Load the content for the stored value from source.
 
virtual error_code< secload (binary_deserializer &source)=0
 Load the content for the stored value from source.
 
virtual rtti_pair type () const =0
 Returns the type number and type information object for the stored value.
 
virtual const void * get () const =0
 Returns a pointer to the stored value.
 
virtual error save (serializer &sink) const =0
 Saves the content of the stored value to sink.
 
virtual error_code< secsave (binary_serializer &sink) const =0
 Saves the content of the stored value to sink.
 
virtual std::string stringify () const =0
 Converts the stored value to a string.
 
virtual type_erased_value_ptr copy () const =0
 Returns a copy of the stored value.
 
bool matches (uint16_t nr, const std::type_info *ptr) const
 Checks whether the type of the stored value matches the type nr and type info object. More...
 
uint16_t type_nr () const
 Returns the type number for the stored value.
 
bool matches (const rtti_pair &rtti) const
 Checks whether the type of the stored value matches rtti.
 
template<class T >
const T & get_as () const
 Convenience function for reinterpret_cast<const T*>(get()).
 
template<class T >
T & get_mutable_as ()
 Convenience function for reinterpret_cast<T*>(get_mutable()).
 

Related Functions

(Note that these are not member functions.)

CAF_CORE_EXPORT error inspect (serializer &f, const type_erased_value &x)
 
CAF_CORE_EXPORT error inspect (deserializer &f, type_erased_value &x)
 
auto inspect (binary_serializer &f, const type_erased_value &x)
 
auto inspect (binary_deserializer &f, type_erased_value &x)
 
auto to_string (const type_erased_value &x)
 

Detailed Description

Represents a single type-erased value.

Member Function Documentation

◆ matches()

bool caf::type_erased_value::matches ( uint16_t  nr,
const std::type_info *  ptr 
) const

Checks whether the type of the stored value matches the type nr and type info object.

Friends And Related Function Documentation

◆ inspect() [1/4]

CAF_CORE_EXPORT error inspect ( serializer f,
const type_erased_value x 
)
related

◆ inspect() [2/4]

CAF_CORE_EXPORT error inspect ( deserializer f,
type_erased_value x 
)
related

◆ inspect() [3/4]

auto inspect ( binary_serializer f,
const type_erased_value x 
)
related

◆ inspect() [4/4]

auto inspect ( binary_deserializer f,
type_erased_value x 
)
related

◆ to_string()

auto to_string ( const type_erased_value x)
related

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