BIRNET Interface Reference

/opt/src/beast/birnet/birnetutils.hh

SYNOPSIS

class  Birnet::AlignedArray;
class  Birnet::DataKey;
class  Birnet::DataList;
class  Birnet::DataList::Node;
class  Birnet::DataList::NodeBase;
class  Birnet::DataListContainer;
class  Birnet::Deletable;
class  Birnet::Deletable::DeletionHook;
class  Birnet::InitHook;
class  Birnet::ReferenceCountImpl;
class  Birnet::VirtualTypeid;
   
void  BREAKPOINT  ();
void  _birnet_init_threads  ();
const String  basename  (path);
RandIter  binary_lookup  (begin, end, cmp_elements, arg);
std::pair< RandIter, bool >  binary_lookup_fuzzy  (begin, end, cmp_elements, arg);
std::pair< RandIter, bool >  binary_lookup_insertion_pos  (begin, end, cmp_elements, arg);
RandIter  binary_lookup_sibling  (begin, end, cmp_elements, arg);
void  birnet_init  (argcp, argvp, app_name, ivalues);
void  birnet_runtime_problem  (ewran_tag, domain, file, line, funcname, msgformat, ...);
void void  birnet_runtime_problemv  (ewran_tag, domain, file, line, funcname, msgformat, msgargs);
bool  check  (file, mode);
uint  cleanup_add  (timeout_ms, destroy_data, data);
void  cleanup_force_handlers  ();
char*  cxx_demangle  (mangled_identifier);
const String  dirname  (path);
bool  equals  (file1, file2);
InitSettings  init_settings  ();
bool  init_value_bool  (value);
double  init_value_double  (value);
int64  init_value_int  (value);
void  invalid_type  ();
bool  isabs  (path);
const String  join  (frag0, frag1, frag2, frag3, frag4, frag5, frag6, frag7, frag8, frag9, frag10, frag11, frag12, frag13, frag14, frag15);
void*  malloc_aligned  (total_size, alignment, free_pointer);
void  memset4  (mem, filler, length);
void  raise_sigtrap  ();
Obj &  ref  (obj);
Obj*  ref  (obj);
Obj &  ref_sink  (obj);
Obj*  ref_sink  (obj);
void  sink  (obj);
void  sink  (obj);
const String  skip_root  (path);
int  string_cmp_uuid  (uuid_string1, uuid_string2);
String  string_from_bool  (value);
String  string_from_double  (value);
String  string_from_errno  (errno_val);
String  string_from_float  (value);
String  string_from_float  (value);
String  string_from_int  (value);
String  string_from_type  (value);
String  string_from_type< bool >  (value);
String  string_from_type< double >  (value);
String  string_from_type< float >  (value);
String  string_from_type< int >  (value);
String  string_from_type< int16 >  (value);
String  string_from_type< int64 >  (value);
String  string_from_type< uint >  (value);
String  string_from_type< uint16 >  (value);
String  string_from_type< uint64 >  (value);
String  string_from_uint  (value);
String  string_from_vector  (dvec, delim);
bool  string_has_int  (string);
bool  string_is_uuid  (uuid_string);
String  string_printf  (format, ...);
String  string_strip  (str);
bool  string_to_bool  (string);
double  string_to_double  (string);
double  string_to_float  (string);
int64  string_to_int  (string, base);
Type  string_to_type  (string);
bool  string_to_type< bool >  (string);
double  string_to_type< double >  (string);
float  string_to_type< float >  (string);
int  string_to_type< int >  (string);
int16  string_to_type< int16 >  (string);
int64  string_to_type< int64 >  (string);
uint  string_to_type< uint >  (string);
uint16  string_to_type< uint16 >  (string);
uint64  string_to_type< uint64 >  (string);
uint64  string_to_uint  (string, base);
vector< double >  string_to_vector  (string);
String  string_tolower  (str);
String  string_totitle  (str);
String  string_toupper  (str);
String String  string_vprintf  (format, vargs);
void  unref  (obj);
void  unref  (obj);
void  url_show  (url);
void  url_show_with_cookie  (url, url_title, cookie);
bool  url_test_show  (url);
bool  url_test_show_with_cookie  (url, url_title, cookie);
uint8*  zintern_decompress  (decompressed_size, cdata, cdata_size);
void  zintern_free  (dc_data);

DESCRIPTION

Birnet::AlignedArray

/opt/src/beast/birnet/birnetutils.hh:560
class Birnet::AlignedArray
{
  unsigned char *unaligned_mem;
  T             *data;
  size_t         n_elements;
  void  allocate_aligned_data  ();
    BIRNET_PRIVATE_CLASS_COPY  ();
    AlignedArray  (elements);
    AlignedArray  (n_elements);
    ~AlignedArray  ();
  T &  operator[]  (pos);
  const T &  operator[]  (pos);
  size_t  size  ();
};

   


  AlignedArray 
(const vector< T >  &elements);

  AlignedArray 
(size_t n_elements);

  ~AlignedArray 
();

T &  operator[] 
(size_t pos);

const T &  operator[] 
(size_t pos);

size_t  size 
();

Birnet::DataKey

/opt/src/beast/birnet/birnetutils.hh:437
class Birnet::DataKey
{
    DataKey  ();
  DataKey &  operator=  ();
    DataKey  ();
  Type  fallback  ();
  void  destroy  (data);
    ~DataKey  ();
};

   
  DataKey 
();

DataKey &  operator= 
();

  DataKey 
();

Type  fallback 
();

void  destroy 
(Type data);

  ~DataKey 
();

Birnet::DataList

/opt/src/beast/birnet/birnetutils.hh:448
class Birnet::DataList
{
  NodeBase *nodes;
    DataList  ();
  void  set  (key, data);
  T  get  (key);
  T  swap  (key, data);
  T  swap  (key);
  void  del  (key);
  void  clear_like_destructor  ();
    ~DataList  ();
  void  set_data  (node);
  NodeBase*  get_data  (key);
  NodeBase*  rip_data  (key);
};

   
  DataList 
();

void  set 
(DataKey< T > *key,
 T             data);

T  get 
(DataKey< T > *key);

T  swap 
(DataKey< T > *key,
 T             data);

T  swap 
(DataKey< T > *key);

void  del 
(DataKey< T > *key);


  ~DataList 
();

void  set_data 
(NodeBase *node);

NodeBase*  get_data 
(DataKey< void > *key);

NodeBase*  rip_data 
(DataKey< void > *key);

Birnet::DataList::Node

/opt/src/beast/birnet/birnetutils.hh:458
class Birnet::DataList::Node
{
  T data;
  T  get_data  ();
  T  swap  (d);
    ~Node  ();
    Node  (k, d);
};

   
T  get_data 
();

T  swap 
(T d);

  ~Node 
();

  Node 
(DataKey< T > *k,
 T             d);

Birnet::DataList::NodeBase

/opt/src/beast/birnet/birnetutils.hh:449
class Birnet::DataList::NodeBase
{
  NodeBase        *next;
  DataKey< void > *key;
    NodeBase  (k);
    ~NodeBase  ();
};

   
  NodeBase 
(DataKey< void > *k);

  ~NodeBase 
();

Birnet::DataListContainer

/opt/src/beast/birnet/birnetutils.hh:548

   
void  set_data 
(DataKey< Type > *key,
 Type             data);

Type  get_data 
(DataKey< Type > *key);

Type  swap_data 
(DataKey< Type > *key,
 Type             data);

Type  swap_data 
(DataKey< Type > *key);

void  delete_data 
(DataKey< Type > *key);

Birnet::Deletable

/opt/src/beast/birnet/birnetutils.hh:237
Deletable is a virtual base class that can be derived from (usually with public virtual) to ensure an object has a vtable and a virtual destructor. Also, it allows deletion hooks to be called during the objects destructor, by deriving from Birnet::Deletable::DeletionHook. No extra per-object space is consumed to allow deletion hooks, which makes Deletable a suitable base type for classes that may or may not need this feature (e.g. objects that can but often aren't used for signal handler connections).
   
void  add_deletion_hook 
(DeletionHook *hook);
Add an uninstalled deletion hook to the deletable. This function is MT-safe and may be called from any thread.
hook: valid deletion hook


void  remove_deletion_hook 
(DeletionHook *hook);
Remove a previously added deletion hook. This function is MT-safe and may be called from any thread.
hook: valid deletion hook


Invoke all deletion hooks installed on this deletable.

  ~Deletable 
();

Birnet::Deletable::DeletionHook

/opt/src/beast/birnet/birnetutils.hh:242
DeletionHook is the base implementation class for hooks which are hooked up into the deletion phase of a Birnet::Deletable.
   
  ~DeletionHook 
();

void  monitoring_deletable 
(Deletable  &deletable);


  DeletionHook 
();

bool  deletable_add_hook 
(void *any);

bool  deletable_add_hook 
(Deletable *deletable);
Adds the deletion hook to deletable if it is non NULL. The deletion hook is asserted to be so far uninstalled. This function is MT-safe and may be called from any thread.
deletable: possible Deletable* handle
RETURNS: TRUE if the hook was added


bool  deletable_remove_hook 
(void *any);

bool  deletable_remove_hook 
(Deletable *deletable);
Removes the deletion hook from deletable if it is non NULL. The deletion hook is asserted to be installed on deletable. This function is MT-safe and may be called from any thread.
deletable: possible Deletable* handle
RETURNS: TRUE if the hook was removed


Birnet::InitHook

/opt/src/beast/birnet/birnetutils.hh:93
class Birnet::InitHook
{
  InitHook    *next;
  int          priority;
  InitHookFunc hook;
    BIRNET_PRIVATE_CLASS_COPY  ();
  void  invoke_hooks  ();
    InitHook  (_func, _priority);
};

   


  InitHook 
(InitHookFunc _func,
 int          _priority);

Birnet::ReferenceCountImpl

/opt/src/beast/birnet/birnetutils.hh:267
class Birnet::ReferenceCountImpl
{
  uint32       ref_field;
  const uint32 FLOATING_FLAG;
  bool  ref_cas  (oldv, newv);
  uint32  ref_get  ();
  uint32  ref_count  ();
  void  finalize  ();
  void  delete_this  ();
    ~ReferenceCountImpl  ();
    ReferenceCountImpl  ();
  bool  floating  ();
  void  ref  ();
  void  ref_sink  ();
  bool  finalizing  ();
  void  unref  ();
  void  ref_diag  (msg);
  Obj &  ref  (obj);
  Obj*  ref  (obj);
  Obj &  ref_sink  (obj);
  Obj*  ref_sink  (obj);
  void  unref  (obj);
  void  unref  (obj);
  void  sink  (obj);
  void  sink  (obj);
};

   
bool  ref_cas 
(uint32 oldv,
 uint32 newv);

uint32  ref_get 
();

uint32  ref_count 
();

void  finalize 
();

void  delete_this 
();



bool  floating 
();

void  ref 
();

void  ref_sink 
();

bool  finalizing 
();

void  unref 
();

void  ref_diag 
(const char *msg);

Obj &  ref 
(Obj  &obj);

Obj*  ref 
(Obj *obj);

Obj &  ref_sink 
(Obj  &obj);

Obj*  ref_sink 
(Obj *obj);

void  unref 
(Obj  &obj);

void  unref 
(Obj *obj);

void  sink 
(Obj  &obj);

void  sink 
(Obj *obj);

Birnet::VirtualTypeid

/opt/src/beast/birnet/birnetutils.hh:45

BREAKPOINT

/opt/src/beast/birnet/birnetutils.hh:112
void  BREAKPOINT 
();

_birnet_init_threads

/opt/src/beast/birnet/birnetutils.hh:617

basename

/opt/src/beast/birnet/birnetutils.hh:168
const String  basename 
(const String  &path);

binary_lookup

/opt/src/beast/birnet/birnetutils.hh:430
RandIter  binary_lookup 
(RandIter    begin,
 RandIter    end,
 Cmp         cmp_elements,
 const Arg  &arg);

binary_lookup_fuzzy

/opt/src/beast/birnet/birnetutils.hh:372
std::pair< RandIter, bool >  binary_lookup_fuzzy 
(RandIter    begin,
 RandIter    end,
 Cmp         cmp_elements,
 const Arg  &arg);

binary_lookup_insertion_pos

/opt/src/beast/birnet/birnetutils.hh:404
std::pair< RandIter, bool >  binary_lookup_insertion_pos 
(RandIter    begin,
 RandIter    end,
 Cmp         cmp_elements,
 const Arg  &arg);

binary_lookup_sibling

/opt/src/beast/birnet/birnetutils.hh:417
RandIter  binary_lookup_sibling 
(RandIter    begin,
 RandIter    end,
 Cmp         cmp_elements,
 const Arg  &arg);

birnet_init

/opt/src/beast/birnet/birnetutils.hh:87
void  birnet_init 
(int        *argcp,
 char     ***argvp,
 const char *app_name,
 InitValue   ivalues);

birnet_runtime_problem

/opt/src/beast/birnet/birnetutils.hh:65
void  birnet_runtime_problem 
(char        ewran_tag,
 const char *domain,
 const char *file,
 int         line,
 const char *funcname,
 const char *msgformat,
 ...);

birnet_runtime_problemv

/opt/src/beast/birnet/birnetutils.hh:72
void void  birnet_runtime_problemv 
(char        ewran_tag,
 const char *domain,
 const char *file,
 int         line,
 const char *funcname,
 const char *msgformat,
 va_list     msgargs);

check

/opt/src/beast/birnet/birnetutils.hh:180
bool  check 
(const String  &file,
 const String  &mode);
Perform various checks on file and return whether all checks passed. On failure, errno is set appropriately, and FALSE is returned. Available features to be checked for are:
  • e - file must exist
  • r - file must be readable
  • w - file must be writable
  • x - file must be executable
  • f - file must be a regular file
  • d - file must be a directory
  • l - file must be a symbolic link
  • c - file must be a character device
  • b - file must be a block device
  • p - file must be a named pipe
  • s - file must be a socket.
file: possibly relative filename
mode: feature string
RETURNS: true if file adhears to mode

cleanup_add

/opt/src/beast/birnet/birnetutils.hh:198
uint  cleanup_add 
(uint           timeout_ms,
 void(*)(void *)destroy_data,
 void          *data);

cleanup_force_handlers

/opt/src/beast/birnet/birnetutils.hh:199
Force all cleanup handlers (see birnet_cleanup_add()) to be immediately executed. This function should be called at program exit to execute cleanup handlers which have timeouts that have not yet expired.

cxx_demangle

/opt/src/beast/birnet/birnetutils.hh:211
char*  cxx_demangle 
(const char *mangled_identifier);

dirname

/opt/src/beast/birnet/birnetutils.hh:167
const String  dirname 
(const String  &path);

equals

/opt/src/beast/birnet/birnetutils.hh:182
bool  equals 
(const String  &file1,
 const String  &file2);
Check whether file1 and file2 are pointing to the same inode in the same file system on the same device.
file1: possibly relative filename
file2: possibly relative filename
RETURNS: TRUE if file1 and file2 are equal

init_settings

/opt/src/beast/birnet/birnetutils.hh:83

init_value_bool

/opt/src/beast/birnet/birnetutils.hh:88
bool  init_value_bool 
(InitValue *value);

init_value_double

/opt/src/beast/birnet/birnetutils.hh:89

init_value_int

/opt/src/beast/birnet/birnetutils.hh:90

invalid_type

/opt/src/beast/birnet/birnetutils.hh:222

isabs

/opt/src/beast/birnet/birnetutils.hh:169
bool  isabs 
(const String  &path);

join

/opt/src/beast/birnet/birnetutils.hh:178
const String  join 
(const String  &frag0,
 const String  &frag1,
 const String  &frag2,
 const String  &frag3,
 const String  &frag4,
 const String  &frag5,
 const String  &frag6,
 const String  &frag7,
 const String  &frag8,
 const String  &frag9,
 const String  &frag10,
 const String  &frag11,
 const String  &frag12,
 const String  &frag13,
 const String  &frag14,
 const String  &frag15);

malloc_aligned

/opt/src/beast/birnet/birnetutils.hh:208
void*  malloc_aligned 
(size_t  total_size,
 size_t  alignment,
 uint8 **free_pointer);

memset4

/opt/src/beast/birnet/birnetutils.hh:204
void  memset4 
(uint32 *mem,
 uint32  filler,
 uint    length);

raise_sigtrap

/opt/src/beast/birnet/birnetutils.hh:106

ref

/opt/src/beast/birnet/birnetutils.hh:356
Obj &  ref 
(Obj  &obj);

ref

/opt/src/beast/birnet/birnetutils.hh:357
Obj*  ref 
(Obj *obj);

ref_sink

/opt/src/beast/birnet/birnetutils.hh:358
Obj &  ref_sink 
(Obj  &obj);

ref_sink

/opt/src/beast/birnet/birnetutils.hh:359
Obj*  ref_sink 
(Obj *obj);

sink

/opt/src/beast/birnet/birnetutils.hh:362
void  sink 
(Obj  &obj);

sink

/opt/src/beast/birnet/birnetutils.hh:363
void  sink 
(Obj *obj);

skip_root

/opt/src/beast/birnet/birnetutils.hh:170
const String  skip_root 
(const String  &path);

string_cmp_uuid

/opt/src/beast/birnet/birnetutils.hh:163
int  string_cmp_uuid 
(const String  &uuid_string1,
 const String  &uuid_string2);

string_from_bool

/opt/src/beast/birnet/birnetutils.hh:126
String  string_from_bool 
(bool value);

string_from_double

/opt/src/beast/birnet/birnetutils.hh:134

string_from_errno

/opt/src/beast/birnet/birnetutils.hh:160
String  string_from_errno 
(int errno_val);

string_from_float

/opt/src/beast/birnet/birnetutils.hh:132

string_from_float

/opt/src/beast/birnet/birnetutils.hh:135

string_from_int

/opt/src/beast/birnet/birnetutils.hh:131

string_from_type

/opt/src/beast/birnet/birnetutils.hh:138

string_from_type< bool >

/opt/src/beast/birnet/birnetutils.hh:144
String  string_from_type< bool > 
(bool value);

string_from_type< double >

/opt/src/beast/birnet/birnetutils.hh:140

string_from_type< float >

/opt/src/beast/birnet/birnetutils.hh:142

string_from_type< int >

/opt/src/beast/birnet/birnetutils.hh:150

string_from_type< int16 >

/opt/src/beast/birnet/birnetutils.hh:146

string_from_type< int64 >

/opt/src/beast/birnet/birnetutils.hh:154

string_from_type< uint >

/opt/src/beast/birnet/birnetutils.hh:152

string_from_type< uint16 >

/opt/src/beast/birnet/birnetutils.hh:148

string_from_type< uint64 >

/opt/src/beast/birnet/birnetutils.hh:156

string_from_uint

/opt/src/beast/birnet/birnetutils.hh:128

string_from_vector

/opt/src/beast/birnet/birnetutils.hh:159
String  string_from_vector 
(const vector< double >  &dvec,
 const String            &delim);

string_has_int

/opt/src/beast/birnet/birnetutils.hh:129
bool  string_has_int 
(const String  &string);

string_is_uuid

/opt/src/beast/birnet/birnetutils.hh:161
bool  string_is_uuid 
(const String  &uuid_string);

string_printf

/opt/src/beast/birnet/birnetutils.hh:122
String  string_printf 
(const char *format,
 ...);

string_strip

/opt/src/beast/birnet/birnetutils.hh:124
String  string_strip 
(const String  &str);

string_to_bool

/opt/src/beast/birnet/birnetutils.hh:125
bool  string_to_bool 
(const String  &string);

string_to_double

/opt/src/beast/birnet/birnetutils.hh:133
double  string_to_double 
(const String  &string);

string_to_float

/opt/src/beast/birnet/birnetutils.hh:136
double  string_to_float 
(const String  &string);

string_to_int

/opt/src/beast/birnet/birnetutils.hh:130
int64  string_to_int 
(const String  &string,
 uint           base);

string_to_type

/opt/src/beast/birnet/birnetutils.hh:137
Type  string_to_type 
(const String  &string);

string_to_type< bool >

/opt/src/beast/birnet/birnetutils.hh:143
bool  string_to_type< bool > 
(const String  &string);

string_to_type< double >

/opt/src/beast/birnet/birnetutils.hh:139

string_to_type< float >

/opt/src/beast/birnet/birnetutils.hh:141

string_to_type< int >

/opt/src/beast/birnet/birnetutils.hh:149

string_to_type< int16 >

/opt/src/beast/birnet/birnetutils.hh:145

string_to_type< int64 >

/opt/src/beast/birnet/birnetutils.hh:153

string_to_type< uint >

/opt/src/beast/birnet/birnetutils.hh:151

string_to_type< uint16 >

/opt/src/beast/birnet/birnetutils.hh:147

string_to_type< uint64 >

/opt/src/beast/birnet/birnetutils.hh:155

string_to_uint

/opt/src/beast/birnet/birnetutils.hh:127
uint64  string_to_uint 
(const String  &string,
 uint           base);

string_to_vector

/opt/src/beast/birnet/birnetutils.hh:157
vector< double >  string_to_vector 
(const String  &string);

string_tolower

/opt/src/beast/birnet/birnetutils.hh:119

string_totitle

/opt/src/beast/birnet/birnetutils.hh:121

string_toupper

/opt/src/beast/birnet/birnetutils.hh:120

string_vprintf

/opt/src/beast/birnet/birnetutils.hh:123
String String  string_vprintf 
(const char *format,
 va_list     vargs);

unref

/opt/src/beast/birnet/birnetutils.hh:360
void  unref 
(Obj  &obj);

unref

/opt/src/beast/birnet/birnetutils.hh:361
void  unref 
(Obj *obj);

url_show

/opt/src/beast/birnet/birnetutils.hh:186
void  url_show 
(const char *url);

url_show_with_cookie

/opt/src/beast/birnet/birnetutils.hh:189
void  url_show_with_cookie 
(const char *url,
 const char *url_title,
 const char *cookie);

url_test_show

/opt/src/beast/birnet/birnetutils.hh:190
bool  url_test_show 
(const char *url);

url_test_show_with_cookie

/opt/src/beast/birnet/birnetutils.hh:193
bool  url_test_show_with_cookie 
(const char *url,
 const char *url_title,
 const char *cookie);

zintern_decompress

/opt/src/beast/birnet/birnetutils.hh:216
uint8*  zintern_decompress 
(unsigned int         decompressed_size,
 const unsigned char *cdata,
 unsigned int         cdata_size);
Decompress the data from cdata of length cdata_size into a newly allocated block of size decompressed_size which is returned. The returned block needs to be freed with g_free(). This function is intended to decompress data which has been compressed with the birnet-zintern utility, so no errors should occour during decompression. Consequently, if any error occours during decompression or if the resulting data block is of a size other than decompressed_size, the program will abort with an appropriate error message. If not enough memory could be allocated for decompression, NULL is returned.
decompressed_size: exact size of the decompressed data to be returned
cdata: compressed data block
cdata_size: exact size of the compressed data block
RETURNS: decompressed data block or NULL in low memory situations

zintern_free

/opt/src/beast/birnet/birnetutils.hh:217
void  zintern_free 
(uint8 *dc_data);