tool::internals::SI_unit< OneUnitInBits > Struct Template Reference

Helper class to display human readable bit sizes. More...

#include <wipal/tool/si.hh>

List of all members.

Public Member Functions

 SI_unit (size_t)
template<size_t OneRHSUnitInBits>
 SI_unit (const SI_unit< OneRHSUnitInBits > &)
size_t bits () const
size_t bytes () const
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_
template<>
const char * abbrev_

Static Public Member Functions

static std::string abbrev ()


Detailed Description

template<size_t OneUnitInBits>
struct tool::internals::SI_unit< OneUnitInBits >

Helper class to display human readable bit sizes.

E.g.

 typedef SI_unit<8>     byte;
 typedef SI_unit<8192>  kilobyte;

 const int i = 65536;

 std::cout << i << " bits is "
           << byte (i) << " and "
           << kilobyte (i) << std::endl;

Constructor & Destructor Documentation

template<size_t OneUnitInBits>
tool::internals::SI_unit< OneUnitInBits >::SI_unit ( size_t  count  )  [inline]

Construct a SI_unit from a number of bits.

template<size_t OneUnitInBits>
template<size_t OneRHSUnitInBits>
tool::internals::SI_unit< OneUnitInBits >::SI_unit ( const SI_unit< OneRHSUnitInBits > &  rhs  )  [inline]

Automatic conversion from one SI_unit to another.


Member Function Documentation

template<size_t OneUnitInBits>
size_t tool::internals::SI_unit< OneUnitInBits >::bits (  )  const [inline]

Retrieve the stored number of bits.

template<size_t OneUnitInBits>
size_t tool::internals::SI_unit< OneUnitInBits >::bytes (  )  const [inline]

Retrieve the stored number of bytes.

template<size_t OneUnitInBits>
std::string tool::internals::SI_unit< OneUnitInBits >::abbrev (  )  [inline, static]

Get this unit's abbreviation.


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

Generated on Thu Feb 21 18:54:22 2008 for wipal by  doxygen 1.5.5