- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
qi::PtrUid Class Reference

`#include <ptruid.hpp>`

## Public Member Functions
| PtrUid (const Uuid &machineUuid, const Uuid &processUuid, const void *ptr)
| PtrUid ()
const uint8_t & | operator[] (size_t n) const BOOST_NOEXCEPT
| Return a const ref to allow the address of the element to be taken. More...

## Friends
std::ostream & | operator<< (std::ostream &o, const PtrUid &uid)
uint8_t * | begin (PtrUid &a) BOOST_NOEXCEPT
uint8_t * | end (PtrUid &a) BOOST_NOEXCEPT
const uint8_t * | begin (const PtrUid &a) BOOST_NOEXCEPT
const uint8_t * | end (const PtrUid &a) BOOST_NOEXCEPT
BOOST_CONSTEXPR size_t | size (const PtrUid &) BOOST_NOEXCEPT
BOOST_CONSTEXPR bool | empty (const PtrUid &a) BOOST_NOEXCEPT
U32Iterator | beginUInt32 (PtrUid &a) BOOST_NOEXCEPT
U32Iterator | endUInt32 (PtrUid &a) BOOST_NOEXCEPT
U32ConstIterator | beginUInt32 (const PtrUid &a) BOOST_NOEXCEPT
U32ConstIterator | endUInt32 (const PtrUid &a) BOOST_NOEXCEPT

## Detailed Description

Allows to uniquely identify a pointer in the universe.

It is in fact a sha1 hash on the concatenation of:

- the machine id (an uuid)
- the process uuid (also an uuid)
- the pointer value (the address itself, not the pointed value)

The process part is an uuid instead of the process id, to avoid that on a single machine two different processes with the same process id (after a loop in the process ids) cause different pointers to have the same `PtrUid`.

A `PtrUid` models the concepts Sequence and Hashable (i.e. std::hash<PtrUid> is defined).

If QI_PTRUID_DEBUG is defined, to ease debugging the first number of the digest is deterministic inside a process (static counter starting at 0).

Definition at line 33 of file ptruid.hpp.

## Constructor & Destructor Documentation

qi::PtrUid::PtrUid | ( | const Uuid & | machineUuid,
|  | const Uuid & | processUuid,
|  | const void * | ptr
| ) |  |
| explicit

qi::PtrUid::PtrUid | ( |  | ) |
| inline

Definition at line 57 of file ptruid.hpp.

## Member Function Documentation

const uint8_t& qi::PtrUid::operator[] | ( | size_t | n | ) | const
| inline

Return a const ref to allow the address of the element to be taken.

Definition at line 98 of file ptruid.hpp.

## Friends And Related Function Documentation

uint8_t* begin | ( | PtrUid & | a | ) |
| friend

Definition at line 67 of file ptruid.hpp.

const uint8_t* begin | ( | const PtrUid & | a | ) |
| friend

Definition at line 77 of file ptruid.hpp.

U32Iterator beginUInt32 | ( | PtrUid & | a | ) |
| friend

Definition at line 105 of file ptruid.hpp.

U32ConstIterator beginUInt32 | ( | const PtrUid & | a | ) |
| friend

Definition at line 115 of file ptruid.hpp.

BOOST_CONSTEXPR bool empty | ( | const PtrUid & | a | ) |
| friend

Definition at line 92 of file ptruid.hpp.

uint8_t* end | ( | PtrUid & | a | ) |
| friend

Definition at line 72 of file ptruid.hpp.

const uint8_t* end | ( | const PtrUid & | a | ) |
| friend

Definition at line 82 of file ptruid.hpp.

U32Iterator endUInt32 | ( | PtrUid & | a | ) |
| friend

Definition at line 110 of file ptruid.hpp.

U32ConstIterator endUInt32 | ( | const PtrUid & | a | ) |
| friend

Definition at line 120 of file ptruid.hpp.

std::ostream& operator<< | ( | std::ostream & | o,
|  | const PtrUid & | uid
| ) |  |
| friend

BOOST_CONSTEXPR size_t size | ( | const PtrUid & |  | ) |
| friend

Definition at line 87 of file ptruid.hpp.

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

- /home/opennao/work/release-2.8/sdk/libqi/qi/ptruid.hpp