#include <Byte.h>
Inheritance diagram for clawsoft::Byte:
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
Public Methods | |
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. | |
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. | |
const String & | toString () |
Returns a string representation of this Byte using 0s and 1s. | |
const char * | getClassName () |
Returns the name of the current class. | |
Static Public Methods | |
int | installedCPUs () |
This will return how many CPUs are installed in the system. | |
double | cpuSpeed () |
This will return the CPU speed in megahertz. | |
int | totalMemory () |
Will return the total amount of system memory. | |
int | freeMemory () |
Will return the total amount of free system memory. | |
void | usleep (Uint32 usec) |
Will freeze the software for usec microseconds. | |
Protected Methods | |
void | setClassName (const char *n) |
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging. | |
Protected Attributes | |
Uint8 | value |
As the name says this is the binary value. |
|
Default constructor, it will initialize value to zero.
|
|
This constructor will initialize the Byte value to v.
|
|
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.
|
|
Almost the sam as the above constructor but the the argument is now a String. The same restrictions apply |
|
Returns the bit in position 0.
|
|
Returns the bit in position 1.
|
|
Returns the bit in position 2.
|
|
Returns the bit in position 3.
|
|
Returns the bit in position 4.
|
|
Returns the bit in position 5.
|
|
Returns the bit in position 6.
|
|
Returns the bit in position 7.
|
|
This will return the CPU speed in megahertz.
|
|
Will return the total amount of free system memory.
|
|
Returns the name of the current class.
|
|
This will return how many CPUs are installed in the system.
|
|
This will invert the byte ordering of every bit.
|
|
This will return a reversed binary version of the value.
|
|
Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.
|
|
This will set the interval value to binary.
|
|
This will set the interval value to binary.
|
|
This will set the interval value to v.
|
|
This will return the binary bit as whole.
|
|
Returns a string representation of this Byte using 0s and 1s.
|
|
Will return the total amount of system memory.
|
|
Will freeze the software for usec microseconds.
|
|
As the name says this is the binary value.
|
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: