#include <bit/integer.h>
Public Types | |
typedef BitPointer< Int< I > > | pointer |
Public Member Functions | |
Int (I v=0, ByteOrder bo=BYTEORDER_HOST) | |
Int (ByteOrder bo) | |
Int (const Data d, ByteOrder databo=BYTEORDER_HOST, ByteOrder bo=BYTEORDER_HOST) | |
Constructor that sets the value from a data object. | |
~Int () | |
virtual Integer::pointer | clone () const |
operator I () const | |
bool | operator< (I i) const |
bool | operator<= (I i) const |
bool | operator== (I i) const |
bool | operator!= (I i) const |
bool | operator>= (I i) const |
bool | operator> (I i) const |
Int< I > & | operator= (I i) |
Int< I > | operator+ (I i) const |
Int< I > | operator- (I i) const |
Int< I > | operator* (I i) const |
Int< I > | operator/ (I i) const |
Int< I > | operator% (I i) const |
Int< I > & | operator+= (I i) |
Int< I > & | operator-= (I i) |
Int< I > & | operator*= (I i) |
Int< I > & | operator/= (I i) |
Int< I > & | operator%= (I i) |
virtual void | set_value (const Data d) |
Sets the value from a data object by directly copying; byte ordering of the data is not considered. | |
virtual void | set_value (const void *mem, size_t size) |
Sets the value from a data object by directly copying; byte ordering of the data is not considered. | |
virtual void | set_value (const Data d, ByteOrder databo) |
Sets the value from a data object. | |
virtual Data | as_data () const |
virtual size_t | size () const |
virtual const void * | voidptr () const |
virtual const std::type_info & | int_type () |
I | host () const |
I | network () const |
I | big_endian () const |
I | little_endian () const |
Static Public Member Functions | |
static pointer | create (I v=0, ByteOrder bo=BYTEORDER_HOST) |
static pointer | create (ByteOrder bo) |
static pointer | create (const Data d, ByteOrder databo=BYTEORDER_HOST, ByteOrder bo=BYTEORDER_HOST) |
Public Attributes | |
I | value |
Protected Member Functions | |
void | convert_value_from_type_to_host () |
void | convert_value_from_host_to_type () |
Reimplemented from bit::Integer.
bit::Int< I >::Int | ( | const Data | d, | |
ByteOrder | databo = BYTEORDER_HOST , |
|||
ByteOrder | bo = BYTEORDER_HOST | |||
) | [inline] |
Constructor that sets the value from a data object.
d | The data object. The first n bytes are used to set the value. | |
databo | The byte order of the data object | |
bo | The byte order of this integer. |
References bit::Int< I >::set_value().
static pointer bit::Int< I >::create | ( | I | v = 0 , |
|
ByteOrder | bo = BYTEORDER_HOST | |||
) | [inline, static] |
Referenced by bit::Int< I >::clone().
static pointer bit::Int< I >::create | ( | const Data | d, | |
ByteOrder | databo = BYTEORDER_HOST , |
|||
ByteOrder | bo = BYTEORDER_HOST | |||
) | [inline, static] |
virtual Integer::pointer bit::Int< I >::clone | ( | ) | const [inline, virtual] |
Implements bit::Integer.
References bit::Integer::byte_order, bit::Int< I >::create(), and bit::Int< I >::value.
bit::Int< I >::operator I | ( | ) | const [inline] |
References bit::Int< I >::host().
bool bit::Int< I >::operator< | ( | I | i | ) | const [inline] |
References bit::Int< I >::host().
bool bit::Int< I >::operator<= | ( | I | i | ) | const [inline] |
References bit::Int< I >::host().
bool bit::Int< I >::operator== | ( | I | i | ) | const [inline] |
References bit::Int< I >::host().
bool bit::Int< I >::operator!= | ( | I | i | ) | const [inline] |
References bit::Int< I >::host().
bool bit::Int< I >::operator>= | ( | I | i | ) | const [inline] |
References bit::Int< I >::host().
bool bit::Int< I >::operator> | ( | I | i | ) | const [inline] |
References bit::Int< I >::host().
References bit::Int< I >::convert_value_from_host_to_type(), and bit::Int< I >::value.
Sets the value from a data object by directly copying; byte ordering of the data is not considered.
d | The data object. The first n bytes are used to set the value. |
Implements bit::Integer.
References bit::Data::data(), bit::Data::size(), and bit::Int< I >::value.
Referenced by bit::Int< I >::Int().
virtual void bit::Int< I >::set_value | ( | const void * | mem, | |
size_t | size | |||
) | [inline, virtual] |
Sets the value from a data object by directly copying; byte ordering of the data is not considered.
Implements bit::Integer.
References bit::Int< I >::value.
virtual void bit::Int< I >::set_value | ( | const Data | d, | |
ByteOrder | databo | |||
) | [inline, virtual] |
Sets the value from a data object.
d | The data object. The first n bytes are used to set the value. | |
databo | The byte order of the data object |
Implements bit::Integer.
References bit::be_to_host(), bit::Integer::byte_order, bit::BYTEORDER_BIG_ENDIAN, bit::BYTEORDER_HOST, bit::BYTEORDER_LITTLE_ENDIAN, bit::BYTEORDER_NETWORK, bit::Data::data(), bit::host_to_le(), bit::host_to_net(), bit::le_to_host(), bit::le_to_net(), bit::net_to_le(), bit::Data::size(), and bit::Int< I >::value.
virtual size_t bit::Int< I >::size | ( | ) | const [inline, virtual] |
Implements bit::Integer.
virtual const void* bit::Int< I >::voidptr | ( | ) | const [inline, virtual] |
virtual const std::type_info& bit::Int< I >::int_type | ( | ) | [inline, virtual] |
Implements bit::Integer.
I bit::Int< I >::host | ( | ) | const [inline] |
References bit::Integer::byte_order, bit::BYTEORDER_BIG_ENDIAN, bit::BYTEORDER_HOST, bit::BYTEORDER_LITTLE_ENDIAN, bit::BYTEORDER_NETWORK, bit::le_to_host(), bit::net_to_host(), and bit::Int< I >::value.
Referenced by bit::Int< I >::operator I(), bit::Integer::operator T(), bit::Int< I >::operator!=(), bit::Int< I >::operator<(), bit::Int< I >::operator<=(), bit::Int< I >::operator==(), bit::Int< I >::operator>(), and bit::Int< I >::operator>=().
I bit::Int< I >::network | ( | ) | const [inline] |
I bit::Int< I >::big_endian | ( | ) | const [inline] |
References bit::Int< I >::network().
I bit::Int< I >::little_endian | ( | ) | const [inline] |
void bit::Int< I >::convert_value_from_type_to_host | ( | ) | [inline, protected] |
References bit::Integer::byte_order, bit::BYTEORDER_BIG_ENDIAN, bit::BYTEORDER_HOST, bit::BYTEORDER_LITTLE_ENDIAN, bit::BYTEORDER_NETWORK, bit::le_to_host(), bit::net_to_host(), and bit::Int< I >::value.
Referenced by bit::Int< I >::operator%(), bit::Int< I >::operator%=(), bit::Int< I >::operator*(), bit::Int< I >::operator*=(), bit::Int< I >::operator+(), bit::Int< I >::operator+=(), bit::Int< I >::operator-(), bit::Int< I >::operator-=(), bit::Int< I >::operator/(), and bit::Int< I >::operator/=().
void bit::Int< I >::convert_value_from_host_to_type | ( | ) | [inline, protected] |
References bit::Integer::byte_order, bit::BYTEORDER_BIG_ENDIAN, bit::BYTEORDER_HOST, bit::BYTEORDER_LITTLE_ENDIAN, bit::BYTEORDER_NETWORK, bit::host_to_le(), bit::host_to_net(), and bit::Int< I >::value.
Referenced by bit::Int< I >::operator%(), bit::Int< I >::operator%=(), bit::Int< I >::operator*(), bit::Int< I >::operator*=(), bit::Int< I >::operator+(), bit::Int< I >::operator+=(), bit::Int< I >::operator-(), bit::Int< I >::operator-=(), bit::Int< I >::operator/(), bit::Int< I >::operator/=(), and bit::Int< I >::operator=().
Referenced by bit::Int< I >::as_data(), bit::Int< I >::clone(), bit::Int< I >::convert_value_from_host_to_type(), bit::Int< I >::convert_value_from_type_to_host(), bit::Int< I >::host(), bit::Int< I >::little_endian(), bit::Int< I >::network(), bit::Int< I >::operator%(), bit::Int< I >::operator%=(), bit::Int< I >::operator*(), bit::Int< I >::operator*=(), bit::Int< I >::operator+(), bit::Int< I >::operator+=(), bit::Int< I >::operator-(), bit::Int< I >::operator-=(), bit::Int< I >::operator/(), bit::Int< I >::operator/=(), bit::Int< I >::operator=(), bit::Int< I >::set_value(), and bit::Int< I >::voidptr().