![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Build in-memory circuits from the mmap-backed store. More...
#include <cmath>#include <boost/archive/binary_iarchive.hpp>#include <boost/iostreams/device/array.hpp>#include <boost/iostreams/stream.hpp>#include "CircuitFromMMap.h"#include "having_semantics.hpp"#include "semiring/BoolExpr.h"#include "provsql_utils_cpp.h"#include "provsql_shmem.h"#include "provsql_mmap.h"
Go to the source code of this file.
Functions | |
| template<typename C > | |
| static C | getCircuitFromMMap (pg_uuid_t token, char message_char) |
Read and deserialise a circuit rooted at token from the mmap worker. | |
| BooleanCircuit | getBooleanCircuit (pg_uuid_t token, gate_t &gate) |
Build a BooleanCircuit from the mmap store rooted at token. | |
| GenericCircuit | getGenericCircuit (pg_uuid_t token) |
Build a GenericCircuit from the mmap store rooted at token. | |
Build in-memory circuits from the mmap-backed store.
Implements the free functions declared in CircuitFromMMap.h:
getBooleanCircuit(): reads the mmap store (via the background worker IPC channel) and constructs a BooleanCircuit.getGenericCircuit(): same but constructs a GenericCircuit.The internal getCircuitFromMMap<C>() template handles the IPC protocol: it sends a request through the shared-memory pipe, receives a Boost-serialised circuit blob from the background worker, and deserialises it into the appropriate circuit type.
Definition in file CircuitFromMMap.cpp.
| BooleanCircuit getBooleanCircuit | ( | pg_uuid_t | token, |
| gate_t & | gate | ||
| ) |
Build a BooleanCircuit from the mmap store rooted at token.
Performs a depth-first traversal of the persistent circuit starting at token, translating each gate_type to the corresponding BooleanGate and copying probabilities and info integers.
On return, gate is set to the gate_t identifier within the returned circuit that corresponds to token.
| token | UUID of the root gate. |
| gate | Output: gate_t of the root within the returned circuit. |
BooleanCircuit. Definition at line 73 of file CircuitFromMMap.cpp.


|
static |
Read and deserialise a circuit rooted at token from the mmap worker.
| C | Circuit type to deserialise (BooleanCircuit or GenericCircuit). |
| token | UUID of the root gate to retrieve. |
| message_char | IPC message-type byte sent to the background worker. |
C. Definition at line 39 of file CircuitFromMMap.cpp.

| GenericCircuit getGenericCircuit | ( | pg_uuid_t | token | ) |
Build a GenericCircuit from the mmap store rooted at token.
Equivalent to createGenericCircuit() declared in MMappedCircuit.h. Performs a depth-first traversal and copies all gate metadata (type, info1/info2, extra strings, probabilities) into the returned GenericCircuit.
| token | UUID of the root gate. |
GenericCircuit. Definition at line 99 of file CircuitFromMMap.cpp.
