aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/cpp/doc/world.rst
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-16 10:26:47 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit8fb8b922fb7575d7aed2f2184a02586b56ba873a (patch)
tree06ea3a48cefb5cb221359b17911380460e68e7c8 /bindings/cpp/doc/world.rst
parent74ddf7934336f16dcdce688333040d82972817fc (diff)
downloadserd-8fb8b922fb7575d7aed2f2184a02586b56ba873a.tar.gz
serd-8fb8b922fb7575d7aed2f2184a02586b56ba873a.tar.bz2
serd-8fb8b922fb7575d7aed2f2184a02586b56ba873a.zip
[WIP] Add C++ bindings
Diffstat (limited to 'bindings/cpp/doc/world.rst')
-rw-r--r--bindings/cpp/doc/world.rst45
1 files changed, 45 insertions, 0 deletions
diff --git a/bindings/cpp/doc/world.rst b/bindings/cpp/doc/world.rst
new file mode 100644
index 00000000..d6736485
--- /dev/null
+++ b/bindings/cpp/doc/world.rst
@@ -0,0 +1,45 @@
+World
+=====
+
+.. default-domain:: cpp
+.. highlight:: cpp
+.. namespace:: serd
+
+So far, we have only used nodes and statements,
+which are simple independent objects.
+Higher-level facilities in Serd require a :struct:`World`,
+which represents the global library state.
+
+A program typically uses just one world,
+which can be constructed with no arguments:
+
+.. literalinclude:: overview.cpp
+ :start-after: begin world-new
+ :end-before: end world-new
+ :dedent: 2
+
+All "global" library state is handled explicitly via the world.
+Serd does not contain any static mutable data,
+allowing it to be used concurrently in several parts of a program,
+for example in plugins.
+
+If multiple worlds *are* used in a single program,
+they must never be mixed:
+objects "inside" one world can not be used with objects inside another.
+
+Note that the world is not a database,
+it only manages a small amount of library state for things like configuration and logging.
+
+Generating Blanks
+-----------------
+
+Blank nodes, or simply "blanks",
+are used for resources that do not have URIs.
+Unlike URIs, they are not global identifiers,
+and only have meaning within their local context (for example, a document).
+The world provides a method for automatically generating unique blank identifiers:
+
+.. literalinclude:: overview.cpp
+ :start-after: begin get-blank
+ :end-before: end get-blank
+ :dedent: 2