OverSim
P2pns::OverlayKeyObject Class Reference
Inheritance diagram for P2pns::OverlayKeyObject:
OverlayKey

Public Member Functions

 OverlayKeyObject (const OverlayKey &key)
- Public Member Functions inherited from OverlayKey
 OverlayKey ()
 Default constructor.
 OverlayKey (uint32_t num)
 Constructs an overlay key initialized with a common integer.
 OverlayKey (const unsigned char *buffer, uint32_t size)
 Constructs a key out of a buffer.
 OverlayKey (const std::string &str, uint32_t base=16)
 Constructs a key out of a string number.
 OverlayKey (const OverlayKey &rhs)
 Copy constructor.
 ~OverlayKey ()
 Default destructor.
std::string toString (uint32_t base=16) const
 Returns a string representation of this key.
bool isUnspecified () const
 Returns true, if the key is unspecified.
bool operator< (const OverlayKey &compKey) const
 compares this to a given OverlayKey
bool operator> (const OverlayKey &compKey) const
 compares this to a given OverlayKey
bool operator<= (const OverlayKey &compKey) const
 compares this to a given OverlayKey
bool operator>= (const OverlayKey &compKey) const
 compares this to a given OverlayKey
bool operator== (const OverlayKey &compKey) const
 compares this to a given OverlayKey
bool operator!= (const OverlayKey &compKey) const
 compares this to a given OverlayKey
int compareTo (const OverlayKey &compKey) const
 Unifies all compare operations in one method.
OverlayKeyoperator= (const OverlayKey &rhs)
 assigns OverlayKey of rhs to this->key
OverlayKeyoperator-- ()
 substracts 1 from this->key
OverlayKeyoperator++ ()
 adds 1 to this->key
OverlayKeyoperator+= (const OverlayKey &rhs)
 adds rhs->key to this->key
OverlayKeyoperator-= (const OverlayKey &rhs)
 substracts rhs->key from this->key
OverlayKey operator+ (const OverlayKey &rhs) const
 adds rhs->key to this->key
OverlayKey operator- (const OverlayKey &rhs) const
 substracts rhs->key from this->key
OverlayKey operator-- (int)
 substracts 1 from this->key
OverlayKey operator++ (int)
 adds 1 to this->key
OverlayKey operator>> (uint32_t num) const
 bitwise shift right
OverlayKey operator<< (uint32_t num) const
 bitwise shift left
OverlayKey operator& (const OverlayKey &rhs) const
 bitwise AND of rhs->key and this->key
OverlayKey operator| (const OverlayKey &rhs) const
 bitwise OR of rhs->key and this->key
OverlayKey operator^ (const OverlayKey &rhs) const
 bitwise XOR of rhs->key and this->key
OverlayKey operator~ () const
 bitwise NOT of this->key
OverlayKeyBit operator[] (uint32_t n)
 returns the n-th bit of this->key
OverlayKeysetBit (uint32_t pos, bool value)
 sets a bit of this->key
uint32_t getBitRange (uint32_t p, uint32_t n) const
 Returns a sub integer at position p with n-bits.
double toDouble () const
bool getBit (uint32_t p) const
size_t hash () const
 Returns a hash value for the key.
int log_2 () const
 Returns the position of the msb in this key, which represents just the logarithm to base 2.
OverlayKey randomSuffix (uint32_t pos) const
 Fills the suffix starting at pos with random bits to lsb.
OverlayKey randomPrefix (uint32_t pos) const
 Fills the prefix starting at pos with random bits to msb.
uint32_t sharedPrefixLength (const OverlayKey &compKey, uint32_t bitsPerDigit=1) const
 Calculates the number of equal bits (digits) from the left with another Key (shared prefix length)
bool isBetween (const OverlayKey &keyA, const OverlayKey &keyB) const
 Returns true, if this key is element of the interval (keyA, keyB) on the ring.
bool isBetweenR (const OverlayKey &keyA, const OverlayKey &keyB) const
 Returns true, if this key is element of the interval (keyA, keyB] on the ring.
bool isBetweenL (const OverlayKey &keyA, const OverlayKey &keyB) const
 Returns true, if this key is element of the interval [keyA, keyB) on the ring.
bool isBetweenLR (const OverlayKey &keyA, const OverlayKey &keyB) const
 Returns true, if this key is element of the interval [keyA, keyB] on the ring.
void netPack (cCommBuffer *b)
 serializes the object into a buffer
void netUnpack (cCommBuffer *b)
 deserializes the object from a buffer

Additional Inherited Members

- Static Public Member Functions inherited from OverlayKey
static void setKeyLength (uint32_t length)
 Set the length of an OverlayKey.
static uint32_t getLength ()
 Returns the length in number of bits.
static OverlayKey random ()
 Returns a random key.
static OverlayKey getMax ()
 Returns the maximum key, i.e.
static OverlayKey sha1 (const BinaryValue &value)
 Returns a key with the SHA1 cryptographic hash of a BinaryValue.
static OverlayKey pow2 (uint32_t exponent)
 Returns a key 2^exponent.
static void test ()
 A pseudo regression test method.
- Static Public Attributes inherited from OverlayKey
static const OverlayKey UNSPECIFIED_KEY
 OverlayKey without defined key.
static const OverlayKey ZERO
 OverlayKey with key initialized as 0.
static const OverlayKey ONE
 OverlayKey with key initialized as 1.

Detailed Description

Definition at line 63 of file P2pns.h.

Constructor & Destructor Documentation

P2pns::OverlayKeyObject::OverlayKeyObject ( const OverlayKey key)
inline

Definition at line 65 of file P2pns.h.

: OverlayKey(key) {};

The documentation for this class was generated from the following file: