#include <Byte.h>
According to the system the ordering of every bit may vary. Depending on what you think the ordering should be for every bit we will use the following standard in this library
bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 |
TODO: TAKE CARE OF THE PLATFORM ENDIANNESS
Definition at line 37 of file Byte.h.
Public Member Functions | |
Byte () | |
Default constructor, it will initialize value to zero. | |
Byte (UInt8 v) | |
This constructor will initialize the Byte value to v. | |
Byte (const char *binary) | |
This constructor will parse an array of 0s and 1s and will construct a byte, if you use characters different from '0' or '1' or if you use a string larger than 8 chars then you will receive the appropiate exception. | |
Byte (const String &binary) | |
Almost the sam as the above constructor but the the argument is now a String. | |
~Byte () | |
void | setValue (UInt8 v=0) |
This will set the interval value to v. | |
void | setValue (const char *binary) |
This will set the interval value to binary. | |
void | setValue (const String &binary) |
This will set the interval value to binary. | |
UInt8 | theByte () |
This will return the binary bit as whole. | |
UInt8 | reversedByte () |
This will return a reversed binary version of the value. | |
void | reverse () |
This will invert the byte ordering of every bit. | |
bool | bit0 () |
Returns the bit in position 0. | |
bool | bit1 () |
Returns the bit in position 1. | |
bool | bit2 () |
Returns the bit in position 2. | |
bool | bit3 () |
Returns the bit in position 3. | |
bool | bit4 () |
Returns the bit in position 4. | |
bool | bit5 () |
Returns the bit in position 5. | |
bool | bit6 () |
Returns the bit in position 6. | |
bool | bit7 () |
Returns the bit in position 7. | |
std::string | toString () |
Returns a string representation of this Byte using 0s and 1s. | |
virtual const char * | getClassName () |
Returns the name of the current class. | |
Static Public Member Functions | |
static void | usleep (UInt32 usec) |
This will return how many CPUs are installed in the system. | |
static void | debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Will print a debug message to the screen. | |
static void | debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__) |
Protected Attributes | |
UInt8 | value |
As the name says this is the binary value. | |
std::string * | string_representation |
std::string | __cls_name |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Object &s) |
xvr2::Byte::Byte | ( | ) |
Default constructor, it will initialize value to zero.
xvr2::Byte::Byte | ( | const char * | binary | ) |
This constructor will parse an array of 0s and 1s and will construct a byte, if you use characters different from '0' or '1' or if you use a string larger than 8 chars then you will receive the appropiate exception.
xvr2::Byte::Byte | ( | const String & | binary | ) |
Almost the sam as the above constructor but the the argument is now a String.
The same restrictions apply
xvr2::Byte::~Byte | ( | ) |
void xvr2::Byte::setValue | ( | UInt8 | v = 0 |
) |
This will set the interval value to v.
void xvr2::Byte::setValue | ( | const char * | binary | ) |
This will set the interval value to binary.
void xvr2::Byte::setValue | ( | const String & | binary | ) |
This will set the interval value to binary.
UInt8 xvr2::Byte::theByte | ( | ) |
This will return the binary bit as whole.
UInt8 xvr2::Byte::reversedByte | ( | ) |
This will return a reversed binary version of the value.
void xvr2::Byte::reverse | ( | ) |
This will invert the byte ordering of every bit.
bool xvr2::Byte::bit0 | ( | ) |
Returns the bit in position 0.
bool xvr2::Byte::bit1 | ( | ) |
Returns the bit in position 1.
bool xvr2::Byte::bit2 | ( | ) |
Returns the bit in position 2.
bool xvr2::Byte::bit3 | ( | ) |
Returns the bit in position 3.
bool xvr2::Byte::bit4 | ( | ) |
Returns the bit in position 4.
bool xvr2::Byte::bit5 | ( | ) |
Returns the bit in position 5.
bool xvr2::Byte::bit6 | ( | ) |
Returns the bit in position 6.
bool xvr2::Byte::bit7 | ( | ) |
Returns the bit in position 7.
std::string xvr2::Byte::toString | ( | ) | [virtual] |
static void xvr2::System::usleep | ( | UInt32 | usec | ) | [static, inherited] |
This will return how many CPUs are installed in the system.
This will return the CPU speed in megahertz Will return the total amount of system memory Will return the total amount of free system memory Will freeze the software for usec microseconds
virtual const char* xvr2::Object::getClassName | ( | ) | [virtual, inherited] |
Returns the name of the current class.
static void xvr2::Object::debugmsg | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
Will print a debug message to the screen.
static void xvr2::Object::debugmsgln | ( | Object * | obj, | |
const char * | msg, | |||
int | linenumber = __LINE__ , |
|||
const char * | srcfile = __FILE__ | |||
) | [static, inherited] |
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Object & | s | |||
) | [friend, inherited] |
UInt8 xvr2::Byte::value [protected] |
std::string* xvr2::Byte::string_representation [protected] |
std::string xvr2::Object::__cls_name [protected, inherited] |