Lumiera  0.pre.03
»edit your freedom«
luid.h File Reference

Go to the source code of this file.

Description

Lumiera unique object identifier.

Lumiera unique identifiers are 128 byte random values. Unlike standard uuid's we don't tag a version within them and we may store generic pointers within the storage space occupied by an LUID.

Due to the extremely huge number space, LUID values can be used as unique identifiers without the need to check for duplicates or collisions. At various places, LUIDs are thus used right away on creation of new object instances or elements, in case a distinguishable object identity is required, e.g.

  • any new attachment of an object into the session ("placement")
  • unique output designation discovered during the translation into a low-level node graph ("builder")
  • interface slots for external binding and plug-ins

Moreover, there is a Luidgen tool to generate fixed LUIDs to be included into source code. It works by replacing the token LUIDGEN in the source code text by a newly generated (random) LUID in octal representation.

LUIDs can also be used to generate hash values for hash table storage.

See also
HashIndexed Adapter for including a LUID into an object
Placement usage example
luidgen.c
hash-util.h hash type definitions

Definition in file luid.h.

#include "lib/hash-value.h"
#include <stdlib.h>

Macros

#define LUIDGEN   PLEASE_RUN_THE_LUIDGEN_TOOL_ON_THIS_FILE
 LUIDGEN will be replaced by the 'luidgen' tool with a random uuid.
 
#define LUMIERA_UID_CHAR(l, n)   ((unsigned char*)l)[n]
 
#define LUMIERA_UID_ELEMENTS(l)
 
#define LUMIERA_UID_FMT
 
#define LUMIERA_UID_INITIALIZER(l)
 

Functions

void lumiera_uid_copy (lumiera_uid *dest, lumiera_uid *src)
 Copy an luid.
 
int lumiera_uid_eq (const lumiera_uid *luida, const lumiera_uid *luidb)
 Test 2 luid's for equality.
 
void lumiera_uid_gen (lumiera_uid *luid)
 Generate a new luid.
 
size_t lumiera_uid_hash (const lumiera_uid *luid)
 Generate a hash sum over an luid.
 
void * lumiera_uid_ptr_get (const lumiera_uid *luid)
 Retrieve a generic pointer stored in a luid.
 
void lumiera_uid_set_ptr (lumiera_uid *luid, void *ptr)
 Store a generic pointer in a luid.
 

Macro Definition Documentation

◆ LUMIERA_UID_INITIALIZER

#define LUMIERA_UID_INITIALIZER (   l)
Value:
{ \
l[0], l[1], l[2], l[3], l[4], l[5], l[6], l[7], \
l[8], l[9], l[10], l[11], l[12], l[13], l[14], l[15] \
}

Definition at line 60 of file luid.h.

◆ LUMIERA_UID_FMT

#define LUMIERA_UID_FMT
Value:
"\\%.3hho\\%.3hho\\%.3hho\\%.3hho" \
"\\%.3hho\\%.3hho\\%.3hho\\%.3hho" \
"\\%.3hho\\%.3hho\\%.3hho\\%.3hho" \
"\\%.3hho\\%.3hho\\%.3hho\\%.3hho"

Definition at line 69 of file luid.h.

◆ LUMIERA_UID_ELEMENTS

#define LUMIERA_UID_ELEMENTS (   l)
Value:
LUMIERA_UID_CHAR(l,0), LUMIERA_UID_CHAR(l,1), LUMIERA_UID_CHAR(l,2), LUMIERA_UID_CHAR(l,3), \
LUMIERA_UID_CHAR(l,4), LUMIERA_UID_CHAR(l,5), LUMIERA_UID_CHAR(l,6), LUMIERA_UID_CHAR(l,7), \
LUMIERA_UID_CHAR(l,8), LUMIERA_UID_CHAR(l,9), LUMIERA_UID_CHAR(l,10), LUMIERA_UID_CHAR(l,11), \
LUMIERA_UID_CHAR(l,12), LUMIERA_UID_CHAR(l,13), LUMIERA_UID_CHAR(l,14), LUMIERA_UID_CHAR(l,15)

Definition at line 78 of file luid.h.