Project
Loading...
Searching...
No Matches
gNeric::rc_mixin< BASE, T > Class Template Reference

Mixin component is used with different data types. More...

#include <runtime_container.h>

Inherits BASE.

Classes

class  member_apply_at
 

Public Types

typedef T wrapped_type
 each stage of the mixin class wraps one type
 
typedef rc_mixin< BASE, wrapped_typemixin_type
 this is the self type
 
typedef boost::mpl::push_back< typenameBASE::types, mixin_type >::type types
 a vector of all mixin stage types so far
 
typedef boost::mpl::plus< typenameBASE::level, boost::mpl::int_< 1 > >::type level
 increment the level counter
 

Public Member Functions

 rc_mixin ()
 
void print ()
 
constexpr std::size_t size () const
 get size at this stage
 
void set (wrapped_type v)
 set member wrapped object
 
wrapped_type get () const
 get wrapped object
 
wrapped_typeoperator* ()
 get wrapped object reference
 
wrapped_typeoperator= (const wrapped_type &v)
 assignment operator to wrapped type
 
 operator wrapped_type () const
 type conversion to wrapped type
 
wrapped_typeoperator+= (const wrapped_type &v)
 operator
 
wrapped_type operator+ (const wrapped_type &v)
 operator
 
template<typename F , bool unroll = false>
F::return_type apply (int index, F f)
 

Detailed Description

template<typename BASE, typename T>
class gNeric::rc_mixin< BASE, T >

Mixin component is used with different data types.

the mixin class

Each mixin component has a member of the specified type. The container level exports the following data types to the outside:

  • wrapped_type the data type at this level
  • mixin_type composed type at this level
  • types mpl sequence containing all level types
  • level a data type containing the level

Definition at line 400 of file runtime_container.h.

Member Typedef Documentation

◆ level

template<typename BASE , typename T >
typedef boost::mpl::plus<typenameBASE::level,boost::mpl::int_<1>>::type gNeric::rc_mixin< BASE, T >::level

increment the level counter

Definition at line 412 of file runtime_container.h.

◆ mixin_type

template<typename BASE , typename T >
typedef rc_mixin<BASE, wrapped_type> gNeric::rc_mixin< BASE, T >::mixin_type

this is the self type

Definition at line 408 of file runtime_container.h.

◆ types

template<typename BASE , typename T >
typedef boost::mpl::push_back<typenameBASE::types,mixin_type>::type gNeric::rc_mixin< BASE, T >::types

a vector of all mixin stage types so far

Definition at line 410 of file runtime_container.h.

◆ wrapped_type

template<typename BASE , typename T >
typedef T gNeric::rc_mixin< BASE, T >::wrapped_type

each stage of the mixin class wraps one type

Definition at line 406 of file runtime_container.h.

Constructor & Destructor Documentation

◆ rc_mixin()

template<typename BASE , typename T >
gNeric::rc_mixin< BASE, T >::rc_mixin ( )
inline

Definition at line 403 of file runtime_container.h.

Member Function Documentation

◆ apply()

template<typename BASE , typename T >
template<typename F , bool unroll = false>
F::return_type gNeric::rc_mixin< BASE, T >::apply ( int  index,
f 
)
inline

apply functor to the runtime object at index TODO: there is a performance issue with this solution, introducing another level of functors makes the access much slower compared with applying to container instance and using container member functions, tested with the add_value functor and bench_runtime_container, also the actual operation needs to be checked, the result is not correct for the last check of 100000000 iterations

Definition at line 485 of file runtime_container.h.

◆ get()

template<typename BASE , typename T >
wrapped_type gNeric::rc_mixin< BASE, T >::get ( ) const
inline

get wrapped object

Definition at line 426 of file runtime_container.h.

◆ operator wrapped_type()

template<typename BASE , typename T >
gNeric::rc_mixin< BASE, T >::operator wrapped_type ( ) const
inline

type conversion to wrapped type

Definition at line 432 of file runtime_container.h.

◆ operator*()

template<typename BASE , typename T >
wrapped_type & gNeric::rc_mixin< BASE, T >::operator* ( )
inline

get wrapped object reference

Definition at line 428 of file runtime_container.h.

◆ operator+()

template<typename BASE , typename T >
wrapped_type gNeric::rc_mixin< BASE, T >::operator+ ( const wrapped_type v)
inline

operator

Definition at line 436 of file runtime_container.h.

◆ operator+=()

template<typename BASE , typename T >
wrapped_type & gNeric::rc_mixin< BASE, T >::operator+= ( const wrapped_type v)
inline

operator

Definition at line 434 of file runtime_container.h.

◆ operator=()

template<typename BASE , typename T >
wrapped_type & gNeric::rc_mixin< BASE, T >::operator= ( const wrapped_type v)
inline

assignment operator to wrapped type

Definition at line 430 of file runtime_container.h.

◆ print()

template<typename BASE , typename T >
void gNeric::rc_mixin< BASE, T >::print ( )
inline

Definition at line 413 of file runtime_container.h.

◆ set()

template<typename BASE , typename T >
void gNeric::rc_mixin< BASE, T >::set ( wrapped_type  v)
inline

set member wrapped object

Definition at line 424 of file runtime_container.h.

◆ size()

template<typename BASE , typename T >
constexpr std::size_t gNeric::rc_mixin< BASE, T >::size ( ) const
inlineconstexpr

get size at this stage

Definition at line 422 of file runtime_container.h.


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