This class makes RAW memory read/write operations easy. To read the value at custom address, you should use read() method. To write the value at custom address, you should use write() method.
For example:
void f(void *ptr) { int a = RAW<int>::read(ptr); // read integer RAW<int>::write(ptr, a + 1); // write integer }
Template argument T should be of POD type.
typedef void* pointer |
Pointer type.
typedef T value_type |
Value type.
static void write | ( | pointer | p, | |
value_type | x | |||
) | [inline, static] |
Write the value.
This method writes the value x at the custom address p.
[in] | p | The custom address. |
[in] | x | The value. |
static value_type read | ( | pointer | p | ) | [inline, static] |
Read the value.
This method reads the value at the custom address p.
[in] | p | The custom address. |