#include <Memory.h>
Inheritance diagram for clawsoft::Memory:
Temporary allocated buffer are like normal in-memory buffer structures, but as the name says they are temporary, after a specified ammount of time this buffers will be deleted from from memory so please be carefull while using them, they can help a lot but if you dont take the necesary safety measures they can hurt you a lot.
Public Methods | |
Memory () | |
Calling this will initialize some vital internal variables and cleanup processes. | |
void * | temporaryAlloc (Uint32 size, Uint32 timeout=60) |
This will allocate a temporary memory buffer if size bytes with an expiration period of timeout seconds. | |
const char * | getClassName () |
Returns the name of the current class. | |
Static Public Methods | |
void * | allocBuffer (Uint32 size) |
Using this will allocate size bytes in memory. | |
void | freeBuffer (void **buf) |
Using this will deallocate the memory used by the buffer buf, call this method to deallocate memory allocated by allocBuffer. | |
void | clearBuffer (void *buf, Uint32 siz, Uint8 value=0) |
Use this method to clear or set every byte in a buffer to a specific value. | |
void * | duplicate (const void *buf, Uint32 siz) |
This allocate a buffer of size siz and will copy everything in buf to make an exact copy on the newly created buffer. | |
void | copy (void *destination, const void *source, Uint32 siz) |
This will copy the contents of source and will put them into destination. | |
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. |
|
Calling this will initialize some vital internal variables and cleanup processes.
|
|
Using this will allocate size bytes in memory.
|
|
Use this method to clear or set every byte in a buffer to a specific value.
|
|
This will copy the contents of source and will put them into destination.
|
|
This will return the CPU speed in megahertz.
|
|
This allocate a buffer of size siz and will copy everything in buf to make an exact copy on the newly created buffer.
|
|
Using this will deallocate the memory used by the buffer buf, call this method to deallocate memory allocated by allocBuffer.
|
|
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.
|
|
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 allocate a temporary memory buffer if size bytes with an expiration period of timeout seconds.
|
|
Will return the total amount of system memory.
|
|
Will freeze the software for usec microseconds.
|
Authors:
Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara
Powered by: