Kagome
Polkadot Runtime Engine in C++17
kagome::common::Wrapper< T, Tag > Struct Template Reference

Make strongly typed structures from different concepts of the equal types. E.g. block height and round number are both uint64_t, but better to be different types. Or, ID and Signature both vectors. More...

#include <wrapper.hpp>

Collaboration diagram for kagome::common::Wrapper< T, Tag >:

Public Member Functions

 Wrapper (T &&t)
 
unwrap ()
 
const T & unwrap () const
 
T & unwrap_mutable ()
 
bool operator== (const Wrapper< T, Tag > &other) const
 

Private Attributes

data_
 

Detailed Description

template<typename T, typename Tag>
struct kagome::common::Wrapper< T, Tag >

Make strongly typed structures from different concepts of the equal types. E.g. block height and round number are both uint64_t, but better to be different types. Or, ID and Signature both vectors.

Template Parameters
Twrapped type
Tagunique tag

Definition at line 24 of file wrapper.hpp.

Constructor & Destructor Documentation

template<typename T, typename Tag>
kagome::common::Wrapper< T, Tag >::Wrapper ( T &&  t)
inlineexplicit

Definition at line 25 of file wrapper.hpp.

Member Function Documentation

template<typename T, typename Tag>
bool kagome::common::Wrapper< T, Tag >::operator== ( const Wrapper< T, Tag > &  other) const
inline

Definition at line 39 of file wrapper.hpp.

template<typename T, typename Tag>
T kagome::common::Wrapper< T, Tag >::unwrap ( )
inline

Definition at line 27 of file wrapper.hpp.

template<typename T, typename Tag>
const T& kagome::common::Wrapper< T, Tag >::unwrap ( ) const
inline

Definition at line 31 of file wrapper.hpp.

template<typename T, typename Tag>
T& kagome::common::Wrapper< T, Tag >::unwrap_mutable ( )
inline

Definition at line 35 of file wrapper.hpp.

Member Data Documentation

template<typename T, typename Tag>
T kagome::common::Wrapper< T, Tag >::data_
private

Definition at line 44 of file wrapper.hpp.


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