Relational NT
A relational database kernel shaped around NT-style object management.
Loading...
Searching...
No Matches
nt::ObjectManager Class Reference

Owns the registry used to locate and reference database objects. More...

#include <ObjectManager.h>

Classes

class  IObject
 Base type for objects stored in the registry. More...
class  Multigroup
 Registry object representing a multigroup snapshot. More...
class  Relation
 Registry object representing a stored relation. More...
class  EphemeralRelation
 Registry object representing an ephemeral relation. More...
class  Transaction
 Abstract registry object representing a transaction. More...
class  Session
 Registry object representing an active connection's session. More...
class  Branch
 A named mutable reference to a branch-tree root. More...
class  BranchTree
 Registry object for a branch-tree blob. More...
struct  object_type
 Describes the behavior and capabilities of an object category. More...
struct  ephemeral_object_type
 Object type descriptor for EPHEMERAL_RELATION objects. More...
struct  registry_head
 Shared metadata stored at the head of a registry entry. More...
struct  registry
 Node in the object registry. More...

Public Member Functions

void Register (std::vector< std::string > path, std::unique_ptr< IObject > object, std::unique_ptr< object_type > type)
 Registers an object under the given path, taking ownership of it.
registry * Find (const std::vector< std::string > object_path)
 Looks into this registry and attempts to retrieve an entry.
bool Unregister (const std::vector< std::string > &object_path)
 Removes the entry registered at object_path, if any.

Public Attributes

std::unique_ptr< registry > entries
 Head of the registry linked list.

Detailed Description

Owns the registry used to locate and reference database objects.

The object manager is the central directory for runtime objects. It keeps the metadata needed to reason about object type, path, references, and handles while the concrete storage model is still being designed.

Member Function Documentation

◆ Find()

ObjectManager::registry * nt::ObjectManager::Find ( const std::vector< std::string > object_path)

Looks into this registry and attempts to retrieve an entry.

Parameters
object_pathLogical path to search for.
Returns
Borrowed pointer to the matching entry, or nullptr when not found.

◆ Register()

void nt::ObjectManager::Register ( std::vector< std::string > path,
std::unique_ptr< IObject > object,
std::unique_ptr< object_type > type )

Registers an object under the given path, taking ownership of it.

Parameters
pathLogical object path.
objectObject payload. Ownership is transferred to the registry.
typeObject type descriptor. Ownership is transferred to the registry.

◆ Unregister()

bool nt::ObjectManager::Unregister ( const std::vector< std::string > & object_path)

Removes the entry registered at object_path, if any.

Splices the matching node out of the registry list and frees its owned object and head. No reference-count checks are performed — the caller is responsible for releasing handles and pins before calling this. Intended for disposable objects (sessions today, other disposables once GC lands in step 6).

Parameters
object_pathLogical path of the entry to remove.
Returns
True when an entry was removed, false when nothing matched.

Member Data Documentation

◆ entries

std::unique_ptr<registry> nt::ObjectManager::entries

Head of the registry linked list.

Owned by this manager.


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