mn::fast_type< Bits, TBaseType > Class Template Reference

#include <mn_fast_type.hpp>

Public Types

using self_type = fast_type< Bits, TBaseType >
 
using value_type = TBaseType
 
using bit_type = fbit
 

Public Member Functions

 fast_type (value_type v)
 
 fast_type (const fast_type &c)
 
unsigned int count ()
 
unsigned int zeros ()
 
unsigned int set (size_t pos, bool p)
 
size_t size ()
 
value_typeoperator[] (const size_t p)
 
self_typeoperator= (value_type &v)
 
self_typeoperator= (self_type &other)
 
bool operator== (self_type &other)
 
bool operator!= (self_type &other)
 
bool operator<= (self_type &other)
 
bool operator>= (self_type &other)
 
bool operator< (self_type &other)
 
bool operator> (self_type &other)
 
self_typeoperator+= (self_type &other)
 
self_typeoperator-= (self_type &other)
 
self_typeoperator*= (self_type &other)
 
self_typeoperator&= (self_type &other)
 
self_typeoperator|= (self_type &other)
 
self_typeoperator^= (self_type &other)
 
self_typeoperator<<= (self_type &other)
 
self_typeoperator>>= (self_type &other)
 
self_typeoperator/= (self_type &other)
 
self_typeoperator+= (value_type &v)
 
self_typeoperator-= (value_type &v)
 
self_typeoperator*= (value_type &v)
 
self_typeoperator/= (value_type &v)
 
self_typeoperator<<= (value_type &v)
 
self_typeoperator>>= (value_type &v)
 
self_typeoperator- (const self_type &rhs)
 
self_typeoperator+ (const self_type &rhs)
 
self_typeoperator* (const self_type &rhs)
 
self_typeoperator/ (const self_type &rhs)
 
self_typeoperator<< (const self_type &rhs)
 
self_typeoperator>> (const self_type &rhs)
 
self_typeoperator| (const self_type &rhs)
 
self_typeoperator^ (const self_type &rhs)
 
self_typeoperator& (const self_type &rhs)
 
self_typeoperator~ ()
 
self_typeoperator++ ()
 
self_typeoperator-- ()
 
self_typeoperator~ ()
 

Public Attributes

union {
value_type Value
 
bit_type bits [Bits]
 
}; 
 

Detailed Description

template<size_t Bits, typename TBaseType>
class mn::fast_type< Bits, TBaseType >

Template class for all fast types, a fast type can manupaleted bittable

Member Typedef Documentation

◆ bit_type

template<size_t Bits, typename TBaseType >
using mn::fast_type< Bits, TBaseType >::bit_type = fbit

◆ self_type

template<size_t Bits, typename TBaseType >
using mn::fast_type< Bits, TBaseType >::self_type = fast_type<Bits, TBaseType>

◆ value_type

template<size_t Bits, typename TBaseType >
using mn::fast_type< Bits, TBaseType >::value_type = TBaseType

Constructor & Destructor Documentation

◆ fast_type() [1/2]

template<size_t Bits, typename TBaseType >
mn::fast_type< Bits, TBaseType >::fast_type ( value_type  v)
inlineexplicit

Ctor

Parameters
value_typethe value for this type
fast_type<int> a(3);

◆ fast_type() [2/2]

template<size_t Bits, typename TBaseType >
mn::fast_type< Bits, TBaseType >::fast_type ( const fast_type< Bits, TBaseType > &  c)
inline

Member Function Documentation

◆ count()

template<size_t Bits, typename TBaseType >
unsigned int mn::fast_type< Bits, TBaseType >::count ( )
inline

Get the count of bits to set to 1

Returns
The count of bits to set to 1

◆ operator!=()

template<size_t Bits, typename TBaseType >
bool mn::fast_type< Bits, TBaseType >::operator!= ( self_type other)
inline

Is the other value with this not equel

Returns
True when not equel and false when not

◆ operator&()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator& ( const self_type rhs)
inline

◆ operator&=()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator&= ( self_type other)
inline

◆ operator*()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator* ( const self_type rhs)
inline

◆ operator*=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator*= ( self_type other)
inline

◆ operator*=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator*= ( value_type v)
inline

◆ operator+()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator+ ( const self_type rhs)
inline

◆ operator++()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator++ ( )
inline

◆ operator+=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator+= ( self_type other)
inline

◆ operator+=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator+= ( value_type v)
inline

◆ operator-()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator- ( const self_type rhs)
inline

◆ operator--()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator-- ( )
inline

◆ operator-=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator-= ( self_type other)
inline

◆ operator-=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator-= ( value_type v)
inline

◆ operator/()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator/ ( const self_type rhs)
inline

◆ operator/=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator/= ( self_type other)
inline

◆ operator/=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator/= ( value_type v)
inline

◆ operator<()

template<size_t Bits, typename TBaseType >
bool mn::fast_type< Bits, TBaseType >::operator< ( self_type other)
inline

◆ operator<<()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator<< ( const self_type rhs)
inline

◆ operator<<=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator<<= ( self_type other)
inline

◆ operator<<=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator<<= ( value_type v)
inline

◆ operator<=()

template<size_t Bits, typename TBaseType >
bool mn::fast_type< Bits, TBaseType >::operator<= ( self_type other)
inline

◆ operator=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator= ( self_type other)
inline

◆ operator=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator= ( value_type v)
inline

Set this fast type value to a new value

Returns
this

◆ operator==()

template<size_t Bits, typename TBaseType >
bool mn::fast_type< Bits, TBaseType >::operator== ( self_type other)
inline

Is the other value with this equel

Returns
True when equel and false when not

◆ operator>()

template<size_t Bits, typename TBaseType >
bool mn::fast_type< Bits, TBaseType >::operator> ( self_type other)
inline

◆ operator>=()

template<size_t Bits, typename TBaseType >
bool mn::fast_type< Bits, TBaseType >::operator>= ( self_type other)
inline

◆ operator>>()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator>> ( const self_type rhs)
inline

◆ operator>>=() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator>>= ( self_type other)
inline

◆ operator>>=() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator>>= ( value_type v)
inline

◆ operator[]()

template<size_t Bits, typename TBaseType >
value_type& mn::fast_type< Bits, TBaseType >::operator[] ( const size_t  p)
inline

Operator to get the bit from given positon

Returns
The bit from given positon

◆ operator^()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator^ ( const self_type rhs)
inline

◆ operator^=()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator^= ( self_type other)
inline

◆ operator|()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator| ( const self_type rhs)
inline

◆ operator|=()

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator|= ( self_type other)
inline

◆ operator~() [1/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator~ ( )
inline

◆ operator~() [2/2]

template<size_t Bits, typename TBaseType >
self_type& mn::fast_type< Bits, TBaseType >::operator~ ( )
inline

◆ set()

template<size_t Bits, typename TBaseType >
unsigned int mn::fast_type< Bits, TBaseType >::set ( size_t  pos,
bool  p 
)
inline

Set the a bit on given position

Parameters
[in]posThe position to set
[in]bThe bit value to set

◆ size()

template<size_t Bits, typename TBaseType >
size_t mn::fast_type< Bits, TBaseType >::size ( )
inline

Get the numbers of bits

Returns
The numbers of bits

◆ zeros()

template<size_t Bits, typename TBaseType >
unsigned int mn::fast_type< Bits, TBaseType >::zeros ( )
inline

Get the count of bits to set to 0

Returns
The count of bits to set to 0

Member Data Documentation

◆ 

union { ... }

The new type


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