title: sgns::crdt::HierarchicalKey summary: A Key represents the unique identifier of an object, inspired by file systems and Google App Engine key model. Keys are meant to be unique across a system. Keys are hierarchical, incorporating more and more specific namespaces. Thus keys can be deemed 'children' or 'ancestors' of other keys:: Key("/Comedy") Key("/Comedy/MontyPython") Also, every namespace can be parametrized to embed relevant object information. For example, the Key name (most specific namespace) could include the object type:: Key("/Comedy/MontyPython/Actor:JohnCleese") Key("/Comedy/MontyPython/Sketch:CheeseShop") Key("/Comedy/MontyPython/Sketch:CheeseShop/Character:Mousebender").
sgns::crdt::HierarchicalKey¶
A Key represents the unique identifier of an object, inspired by file systems and Google App Engine key model. Keys are meant to be unique across a system. Keys are hierarchical, incorporating more and more specific namespaces. Thus keys can be deemed 'children' or 'ancestors' of other keys:: Key("/Comedy") Key("/Comedy/MontyPython") Also, every namespace can be parametrized to embed relevant object information. For example, the Key name (most specific namespace) could include the object type:: Key("/Comedy/MontyPython/Actor:JohnCleese") Key("/Comedy/MontyPython/Sketch:CheeseShop") Key("/Comedy/MontyPython/Sketch:CheeseShop/Character:Mousebender").
#include <hierarchical_key.hpp>
Public Functions¶
| Name | |
|---|---|
| HierarchicalKey() =default | |
| HierarchicalKey(std::string key) | |
| HierarchicalKey(const HierarchicalKey & ) =default | |
| virtual | ~HierarchicalKey() =default |
| HierarchicalKey & | operator=(const HierarchicalKey & ) =default |
| void | SetKey(const std::string & aKey) |
| std::string | GetKey() const |
| HierarchicalKey | ChildString(std::string_view s) const Appends s to the key. |
| std::vector< std::string > | GetList() const |
| bool | IsTopLevel() const |
| bool | operator==(const HierarchicalKey & rhs) const |
| bool | operator!=(const HierarchicalKey & rhs) const |
Public Functions Documentation¶
function HierarchicalKey¶
function HierarchicalKey¶
Parameters:
- key Key string
Constructs a key from a string.
function HierarchicalKey¶
Copy constructor
function ~HierarchicalKey¶
function operator=¶
function SetKey¶
function GetKey¶
function ChildString¶
Appends s to the key.
Parameters:
- s String to be appended
NewKey("/Comedy/MontyPython").ChildString("Actor:JohnCleese") NewKey("/Comedy/MontyPython/Actor:JohnCleese")
function GetList¶
List returns the list representation of this Key. NewKey("/Comedy/MontyPython/Actor:JohnCleese").List() ["Comedy", "MontyPythong", "Actor:JohnCleese"]
function IsTopLevel¶
function operator==¶
function operator!=¶
Updated on 2026-03-04 at 13:10:43 -0800