_vint::detail::vint_small< __length, __sign > Class Template Reference

#include <source/ariba/utility/vtypes/detail/vint_small.hpp>

List of all members.

Public Member Functions

finline vint_small ()
finline vint_small (const type &value)
finline vint_small (const char *text, int base=10)
template<class T>
finline void convert_to (T &v, if_integral(T)) const
finline std::string to_string (int base=10, int str_size=0, char str_fill= '0') const
std::string to_debug_string (int base=10, int str_size=0, char str_fill= '0') const
finline bool get_bit (size_t index) const
finline void set_bit (size_t index, bool v)
finline void set_subint (_self &v, size_t index)
finline void set_subint (uintmax_t v, size_t index)
finline _self get_subint (size_t index, size_t length) const
finline uintmax_t get_subint (size_t index) const
template<typename T>
finline void assign (const T &v, if_integral(T))
finline void assign (const std::string &text, int base=10)
finline int compare_to (const _self &v) const
template<class T>
finline int compare_to (const T &v, if_integral(T)) const
template<class T>
finline void add (const T &rhs, if_integral(T))
finline void add (const _self &rhs)
template<class T>
finline void sub (const T &rhs, if_integral(T))
finline void sub (const _self &rhs)
template<class T>
finline void mul (const T &rhs, if_integral(T))
finline void mul (const _self &rhs)
finline void mul (_self &res_l, _self &res_h, _self &rhs)
template<class T>
finline void mod (const T &rhs, if_integral(T))
finline void mod (const _self &rhs)
finline void mod (_self &res, const _self &rhs)
template<class T>
finline void mod (T &res, const T &rhs, if_integral(T)) const
template<class T>
finline void div (const T &rhs, if_integral(T))
finline void div (const _self &rhs)
finline void div (_self &res, const _self &rhs)
template<class T>
finline void divrem (_self &res_div, _self &res_rem, const T &rhs, if_integral(T))
finline void divrem (_self &res_rem, const _self &rhs)
finline void divrem (_self &res_div, _self &res_rem, const _self &rhs)
template<class T>
finline void divrem (_self &res_div, T &res_rem, const T &rhs, if_integral(T))
finline uintmax_t log2 () const
finline void or_ (const _self &rhs)
finline void and_ (const _self &rhs)
finline void xor_ (const _self &rhs)
finline void complement ()
finline void lshift (size_t steps)
finline void rshift (size_t steps)
finline size_t length () const
finline void set_length (size_t length)
finline bool is_unspecified ()
finline _self max () const
finline _self min () const
finline _self zero () const

Private Types

typedef if_< bool_<(__length >
16 &&__length<=32)>, typename
if_< bool_< __sign >
, boost::int32_t,
boost::uint32_t >::type,
typename if_< bool_<(__length >
8 &&__length<=16)>, typename
if_< bool_< __sign >
, boost::int16_t,
boost::uint16_t >::type,
typename if_< bool_<(__length >
0 &&__length<=8)>, typename
if_< bool_< __sign >
, boost::int8_t,
boost::uint8_t >::type, void >
::type >::type >::type 
type
typedef vint_small< __length,
__sign > 
_self

Private Member Functions

finline void trim ()

Private Attributes

type value

Friends

std::ostream & operator (std::ostream &, const vint_small< __length, __sign > &)


Detailed Description

template<size_t __length = 0, bool __sign = false>
class _vint::detail::vint_small< __length, __sign >

This class implements a integer wrapper for native integer types and adapts it to integers which do not have a length divideable by a power of 2. In this case bits are masked out to mimic the behaviour of a real variable small integer.

SIGNED values are currently unsupported!!!

Sebastian Mies

Definition at line 70 of file vint_small.hpp.


Member Typedef Documentation

template<size_t __length = 0, bool __sign = false>
typedef if_< bool_<(__length> 16 && __length <= 32)>, typename if_<bool_<__sign>, boost::int32_t, boost::uint32_t>::type, typename if_< bool_<(__length> 8 && __length <= 16)>, typename if_<bool_<__sign>, boost::int16_t, boost::uint16_t>::type, typename if_< bool_<(__length> 0 && __length <= 8)>, typename if_<bool_<__sign>, boost::int8_t, boost::uint8_t>::type, void>::type>::type>::type _vint::detail::vint_small< __length, __sign >::type [private]

Definition at line 100 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
typedef vint_small<__length,__sign> _vint::detail::vint_small< __length, __sign >::_self [private]

Definition at line 111 of file vint_small.hpp.


Constructor & Destructor Documentation

template<size_t __length = 0, bool __sign = false>
finline _vint::detail::vint_small< __length, __sign >::vint_small (  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline _vint::detail::vint_small< __length, __sign >::vint_small ( const type value  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline _vint::detail::vint_small< __length, __sign >::vint_small ( const char *  text,
int  base = 10 
) [inline]


Member Function Documentation

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::trim (  )  [inline, private]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::convert_to ( T &  v,
if_integral(T)   
) const [inline]

template<size_t __length = 0, bool __sign = false>
finline std::string _vint::detail::vint_small< __length, __sign >::to_string ( int  base = 10,
int  str_size = 0,
char  str_fill = '0' 
) const [inline]

template<size_t __length = 0, bool __sign = false>
std::string _vint::detail::vint_small< __length, __sign >::to_debug_string ( int  base = 10,
int  str_size = 0,
char  str_fill = '0' 
) const [inline]

template<size_t __length = 0, bool __sign = false>
finline bool _vint::detail::vint_small< __length, __sign >::get_bit ( size_t  index  )  const [inline]

Definition at line 192 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::set_bit ( size_t  index,
bool  v 
) [inline]

Definition at line 196 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::set_subint ( _self v,
size_t  index 
) [inline]

Definition at line 199 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::set_subint ( uintmax_t  v,
size_t  index 
) [inline]

Definition at line 202 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline _self _vint::detail::vint_small< __length, __sign >::get_subint ( size_t  index,
size_t  length 
) const [inline]

Definition at line 205 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline uintmax_t _vint::detail::vint_small< __length, __sign >::get_subint ( size_t  index  )  const [inline]

Definition at line 208 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
template<typename T>
finline void _vint::detail::vint_small< __length, __sign >::assign ( const T &  v,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::assign ( const std::string &  text,
int  base = 10 
) [inline]

template<size_t __length = 0, bool __sign = false>
finline int _vint::detail::vint_small< __length, __sign >::compare_to ( const _self v  )  const [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline int _vint::detail::vint_small< __length, __sign >::compare_to ( const T &  v,
if_integral(T)   
) const [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::add ( const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::add ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::sub ( const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::sub ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::mul ( const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::mul ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::mul ( _self res_l,
_self res_h,
_self rhs 
) [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::mod ( const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::mod ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::mod ( _self res,
const _self rhs 
) [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::mod ( T &  res,
const T &  rhs,
if_integral(T)   
) const [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::div ( const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::div ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::div ( _self res,
const _self rhs 
) [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::divrem ( _self res_div,
_self res_rem,
const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::divrem ( _self res_rem,
const _self rhs 
) [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::divrem ( _self res_div,
_self res_rem,
const _self rhs 
) [inline]

template<size_t __length = 0, bool __sign = false>
template<class T>
finline void _vint::detail::vint_small< __length, __sign >::divrem ( _self res_div,
T &  res_rem,
const T &  rhs,
if_integral(T)   
) [inline]

template<size_t __length = 0, bool __sign = false>
finline uintmax_t _vint::detail::vint_small< __length, __sign >::log2 (  )  const [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::or_ ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::and_ ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::xor_ ( const _self rhs  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::complement (  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::lshift ( size_t  steps  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::rshift ( size_t  steps  )  [inline]

template<size_t __length = 0, bool __sign = false>
finline size_t _vint::detail::vint_small< __length, __sign >::length (  )  const [inline]

Definition at line 351 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline void _vint::detail::vint_small< __length, __sign >::set_length ( size_t  length  )  [inline]

Definition at line 352 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline bool _vint::detail::vint_small< __length, __sign >::is_unspecified (  )  [inline]

Definition at line 353 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline _self _vint::detail::vint_small< __length, __sign >::max (  )  const [inline]

Definition at line 355 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline _self _vint::detail::vint_small< __length, __sign >::min (  )  const [inline]

Definition at line 356 of file vint_small.hpp.

template<size_t __length = 0, bool __sign = false>
finline _self _vint::detail::vint_small< __length, __sign >::zero (  )  const [inline]

Definition at line 357 of file vint_small.hpp.


Friends And Related Function Documentation

template<size_t __length = 0, bool __sign = false>
std::ostream& operator ( std::ostream &  ,
const vint_small< __length, __sign > &   
) [friend]


Member Data Documentation

template<size_t __length = 0, bool __sign = false>
type _vint::detail::vint_small< __length, __sign >::value [private]


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

Generated on Wed May 27 18:23:54 2009 for Ariba by  doxygen 1.5.6