Crypto++ 8.9
Free C++ class library of cryptographic schemes
|
Access a block of memory. More...
#include <misc.h>
Public Member Functions | |
PutBlock (const void *xorBlock, void *block) | |
Construct a PutBlock. | |
template<class U > | |
PutBlock< T, B, A > & | operator() (U x) |
Access a block of memory. | |
Access a block of memory.
T | class or type |
B | enumeration indicating endianness |
A | flag indicating alignment |
PutBlock() provides alternate write access to a block of memory. The enumeration B is BigEndian or LittleEndian. The flag A indicates if the memory block is aligned for class or type T. Repeatedly applying operator() results in advancing in the block of memory.
An example of writing two word32 values from a block of memory is shown below. After the code executes, the byte buffer will be {0,1,2,3,4,5,6,7}
.
word32 w1=0x03020100, w2=0x07060504; byte buffer[8]; PutBlock<word32, LittleEndian> block(NULLPTR, buffer); block(w1)(w2);
|
inline |