AnySet Documentation
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
te::detail::TypedValue< Value, HashFn, Compare > Struct Template Reference

Detailed Description

template<class Value, class HashFn, class Compare>
struct te::detail::TypedValue< Value, HashFn, Compare >

This class is an implementation detail and is not part of the public interface of AnyValue.

TypedValue introduces the static type of the contained object into the inheritence heirarchy but does not, itself contain the object. AnyValueLink implements accessors to the contained object through overloads of a non-member function get_value(). TypedValue knows this statically, and knows that all TypedValue instances are really part of a larger AnyValueLink instance. Therefore, we implement AnyValue's virtual member functions at this point in the heirarchy so that we do not override any member functions of the contained objects, which might be inherited from in AnyValueLink.

Template Parameters
Value- The type of the contained value.

#include <AnyNode.h>

Public Types

using base_type = AnyValue< HashFn, Compare >
 
using value_type = Value
 
using holder_type = ConstValueHolder< value_type >
 
using self_type = TypedValue< Value, HashFn, Compare >
 
using link_type = AnyValueLink< Value, HashFn, Compare >
 
- Public Types inherited from te::AnyValue< HashFn, Compare >
using self_type = AnyValue< HashFn, Compare >
 
using hasher = HashFn
 
using key_equal = Compare
 

Public Member Functions

 TypedValue (const self_type &)=delete
 
 TypedValue (self_type &&)=delete
 
self_typeoperator= (const self_type &)=delete
 
self_typeoperator= (self_type &&)=delete
 
bool equals (const base_type &other) const final override
 
bool not_equals (const base_type &other) const final override
 
bool compare_to (const base_type &other, Compare comp) const final override
 
void write (std::ostream &os) const final override
 
std::unique_ptr< base_typeclone () const final override
 
const std::type_infotypeinfo () const final override
 Get a reference to a std::type_info object that indicates the type of the contained object. More...
 
const value_type & value () const &
 
const value_type && value () const &&
 
- Public Member Functions inherited from te::AnyValue< HashFn, Compare >
 AnyValue (const AnyValue &)=delete
 
 AnyValue (AnyValue &&)=delete
 

Protected Member Functions

 TypedValue (std::size_t hash_v)
 
- Protected Member Functions inherited from te::AnyValue< HashFn, Compare >
 AnyValue (std::size_t hash_v)
 

Friends

const Value * try_as (const AnyValue< HashFn, Compare > &self)
 

Additional Inherited Members

- Public Attributes inherited from te::AnyValue< HashFn, Compare >
const std::size_t hash
 The hash code obtained by invoking an instance of HashFn on the contained object. More...
 

Member Function Documentation

◆ typeinfo()

template<class Value , class HashFn , class Compare >
const std::type_info& te::detail::TypedValue< Value, HashFn, Compare >::typeinfo ( ) const
inlinefinaloverridevirtual

Get a reference to a std::type_info object that indicates the type of the contained object.

Returns
A std::type_info object that indicates the type of the contained object.

Implements te::AnyValue< HashFn, Compare >.

Inheritance diagram for te::detail::TypedValue< Value, HashFn, Compare >:
Inheritance graph
[legend]
Collaboration diagram for te::detail::TypedValue< Value, HashFn, Compare >:
Collaboration graph
[legend]

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