Integers-based Key. More...
#include <rkeys.h>
Public Member Functions | |
RIntsKey (void) | |
RIntsKey (size_t id1, size_t id2) | |
RIntsKey (const RIntsKey &key) | |
size_t | GetSize (void) const |
int | Compare (const char *data) const |
void | Read (R::RKeyValueFile< RIntsKey > &file) |
void | Write (R::RKeyValueFile< RIntsKey > &file) |
R::RString | GetKey (void) const |
RIntsKey & | operator= (const RIntsKey &src) |
Private Attributes | |
size_t | Id1 |
size_t | Id2 |
Detailed Description
Integers-based Key.
The RIntsKey provides a representation for a key that is composed from two integers. It can be used with RKeyValueFile to manage pairs of (key,value).
Constructor & Destructor Documentation
RIntsKey | ( | void | ) |
Default constructor.
RIntsKey | ( | size_t | id1, |
size_t | id2 | ||
) |
Constructor.
- Parameters
-
id1 First integer composing the key. id2 Second integer composing the key.
Member Function Documentation
size_t GetSize | ( | void | ) | const |
Get the size of a key. a size_t.
int Compare | ( | const char * | data | ) | const |
Compare the key with the one pointed by a given pointer.
- Parameters
-
Data containing the key to compare with.
- Returns
- +1, 0 or -1 depending if the current key is greater, identical or smaller than the key to compare with.
void Read | ( | R::RKeyValueFile< RIntsKey > & | file | ) |
Read the key from a key-value file at the current position.
- Parameters
-
file File to read from.
void Write | ( | R::RKeyValueFile< RIntsKey > & | file | ) |
Write the key in a key-value file at the current position.
- Parameters
-
file File to write in.
R::RString GetKey | ( | void | ) | const |
Get a string version of a key.
- Returns
- a RString.
Assignment operator.
- Parameters
-
key Source key.
- Returns
- the key assigned.
Field Documentation
|
private |
First integer composing the key.
|
private |
Second integer composing the key.