OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::TLB Class Reference

#include <TLB.h>

Private Member Functions

 TLB ()
 

Static Private Member Functions

static void addAtom (AtomPtr atom)
 
static bool isInvalidHandle (const Handle &h)
 
static bool isValidHandle (const Handle &h)
 
static UUID getMaxUUID (void)
 
static void reserve_range (UUID lo, UUID hi)
 
static UUID reserve_extent (UUID extent)
 
static void reserve_upto (UUID hi)
 

Static Private Attributes

static std::atomic< UUID_brk_uuid
 

Friends

class Atom
 
class AtomSpaceBenchmark
 
class AtomStorage
 
class AtomTable
 
class ::TLBUTest
 
class ::BasicSaveUTest
 

Detailed Description

Each atom stored in the AtomSpace will have an immutable UUID, which may be used to refer to that atom when a reference to that atom needs to be kept. This allows atoms to be shared between different atomspaces running in different memory spaces (on different machines in a network cluster): a given atom will have a unique UUID by which it is refered to.

Atomspaces are also issued UUID's. This allows atomspaces to be uniquely identified as well.

Reserving UUID's is kind of like mallocing them, except that (currently) there is no way to free them. Use reserve_range() and reserve_extent() to malloc them.

Everything in this class is private, mostly because we don't want anyone to mess with it, except our closest friends.

Definition at line 62 of file TLB.h.

Constructor & Destructor Documentation

opencog::TLB::TLB ( )
inlineprivate

Private default constructor for this class to make it abstract.

Definition at line 76 of file TLB.h.

Member Function Documentation

void opencog::TLB::addAtom ( AtomPtr  atom)
inlinestaticprivate

Adds a new atom to the TLB. If the atom has already be added then an exception is thrown.

Parameters
Atomto be added.
Returns
Handle of the newly added atom.

Definition at line 142 of file TLB.h.

References _brk_uuid, opencog::Handle::UNDEFINED, and opencog::Handle::value().

+ Here is the caller graph for this function:

static UUID opencog::TLB::getMaxUUID ( void  )
inlinestaticprivate

Definition at line 93 of file TLB.h.

References _brk_uuid.

+ Here is the caller graph for this function:

bool opencog::TLB::isInvalidHandle ( const Handle h)
inlinestaticprivate

Definition at line 131 of file TLB.h.

References _brk_uuid, opencog::Handle::UNDEFINED, and opencog::Handle::value().

+ Here is the caller graph for this function:

bool opencog::TLB::isValidHandle ( const Handle h)
inlinestaticprivate

Definition at line 137 of file TLB.h.

References isInvalidHandle().

static UUID opencog::TLB::reserve_extent ( UUID  extent)
inlinestaticprivate

Reserve an extent of UUID's. The lowest reserved ID is returned. That is, after this call, no one else will be issued UUID's in the range of [retval, retval+extent-1].

Definition at line 115 of file TLB.h.

References _brk_uuid.

+ Here is the caller graph for this function:

static void opencog::TLB::reserve_range ( UUID  lo,
UUID  hi 
)
inlinestaticprivate

Reserve a range of UUID's. The range is inclusive; both lo and hi are reserved. The range must NOT intersect with the currently issued UUID's.

Definition at line 98 of file TLB.h.

References _brk_uuid.

static void opencog::TLB::reserve_upto ( UUID  hi)
inlinestaticprivate

Make sure that all UUID's up to at least 'hi' have been reserved. No error checks are made; its OK if 'hi' has already been issued.

Definition at line 123 of file TLB.h.

References _brk_uuid.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ::BasicSaveUTest
friend

Definition at line 69 of file TLB.h.

friend class ::TLBUTest
friend

Definition at line 68 of file TLB.h.

friend class Atom
friend

Definition at line 64 of file TLB.h.

friend class AtomSpaceBenchmark
friend

Definition at line 65 of file TLB.h.

friend class AtomStorage
friend

Definition at line 66 of file TLB.h.

friend class AtomTable
friend

Definition at line 67 of file TLB.h.

Member Data Documentation

std::atomic< UUID > TLB::_brk_uuid
staticprivate

Definition at line 79 of file TLB.h.


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