ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
gate_uuid Struct Reference

A UUID as its 16 bytes, read as two big-endian words. More...

#include "Circuit.h"

Public Member Functions

void toBytes (unsigned char *p) const
 Write the 16 bytes of the UUID to p.
std::string str () const
 The text form of the UUID, as PostgreSQL prints it.
bool operator== (const gate_uuid &o) const
 Equality of the 16 bytes.
bool operator!= (const gate_uuid &o) const
 Inequality of the 16 bytes.
bool operator< (const gate_uuid &o) const
 The order of the bytes.
template<class Archive>
void serialize (Archive &ar, const unsigned int)
 Boost serialisation.

Static Public Member Functions

static gate_uuid fromBytes (const unsigned char *p)
 The UUID whose 16 bytes start at p.
static bool parse (const std::string &s, gate_uuid &u)
 Read s as a UUID in the text form PostgreSQL prints (lowercase, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Public Attributes

std::uint64_t hi = 0
 The first eight bytes, big-endian.
std::uint64_t lo = 0
 The last eight bytes, big-endian.

Detailed Description

A UUID as its 16 bytes, read as two big-endian words.

The key under which a circuit finds a gate from its UUID: hashing and comparing it touches 16 bytes, where the text form of a UUID has 36. Keys compare as their bytes do, in order (as memcmp would).

Definition at line 62 of file Circuit.h.

Member Function Documentation

◆ fromBytes()

gate_uuid gate_uuid::fromBytes ( const unsigned char * p)
inlinestatic

The UUID whose 16 bytes start at p.

Definition at line 67 of file Circuit.h.

Here is the caller graph for this function:

◆ operator!=()

bool gate_uuid::operator!= ( const gate_uuid & o) const
inline

Inequality of the 16 bytes.

Definition at line 139 of file Circuit.h.

◆ operator<()

bool gate_uuid::operator< ( const gate_uuid & o) const
inline

The order of the bytes.

Definition at line 143 of file Circuit.h.

◆ operator==()

bool gate_uuid::operator== ( const gate_uuid & o) const
inline

Equality of the 16 bytes.

Definition at line 135 of file Circuit.h.

◆ parse()

bool gate_uuid::parse ( const std::string & s,
gate_uuid & u )
inlinestatic

Read s as a UUID in the text form PostgreSQL prints (lowercase, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Any other string, even one PostgreSQL would read as the same UUID, is refused, so that the text of a name is given back as it came.

Returns
false if s is not in that form.

Definition at line 93 of file Circuit.h.

Here is the caller graph for this function:

◆ serialize()

template<class Archive>
void gate_uuid::serialize ( Archive & ar,
const unsigned int  )
inline

Boost serialisation.

Definition at line 148 of file Circuit.h.

◆ str()

std::string gate_uuid::str ( ) const
inline

The text form of the UUID, as PostgreSQL prints it.

Definition at line 121 of file Circuit.h.

◆ toBytes()

void gate_uuid::toBytes ( unsigned char * p) const
inline

Write the 16 bytes of the UUID to p.

Definition at line 77 of file Circuit.h.

Here is the caller graph for this function:

Member Data Documentation

◆ hi

std::uint64_t gate_uuid::hi = 0

The first eight bytes, big-endian.

Definition at line 63 of file Circuit.h.

◆ lo

std::uint64_t gate_uuid::lo = 0

The last eight bytes, big-endian.

Definition at line 64 of file Circuit.h.


The documentation for this struct was generated from the following file:
  • /home/pierre/git/software/provsql/src/Circuit.h