diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-05-10 22:59:48 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-05-10 22:59:48 -0300 |
| commit | 7d0fdcf2048bc736c82f84e92dcfc68b3d6ac45c (patch) | |
| tree | a88d6d7cd3886c24bc48a7c4710db1eeffdd0e9a /include/ObjectManager.h | |
| parent | fcfbc5961017e3679c56d9d285a2a3d4d03f0f93 (diff) | |
| download | RNT-7d0fdcf2048bc736c82f84e92dcfc68b3d6ac45c.tar.gz RNT-7d0fdcf2048bc736c82f84e92dcfc68b3d6ac45c.zip | |
add nested loop join strategy to VM and tests
Diffstat (limited to 'include/ObjectManager.h')
| -rw-r--r-- | include/ObjectManager.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/ObjectManager.h b/include/ObjectManager.h index 4b537f7..32b3ae9 100644 --- a/include/ObjectManager.h +++ b/include/ObjectManager.h @@ -4,6 +4,7 @@ #include "Types.h" #include <cstdint> +#include <functional> #include <memory> #include <set> #include <string> @@ -73,6 +74,44 @@ namespace nt * @todo Wire into LifecycleManager::Contention. */ bool exclusive = false; + + virtual ~object_type() = default; + }; + + /** + * @brief Object type descriptor for EPHEMERAL_RELATION objects. + * + * An ephemeral relation has no physical storage. Its tuples are produced + * on demand by a generator function. Cardinality may be finite (e.g. a + * projected stored relation) or AlephZero (e.g. the eq/lt builtins). + * + * The generator receives the bound argument values that were written into + * the cursor by the JOIN operator before each probe, together with a + * pagination offset and limit. It must return at most `limit` tuples + * starting at logical position `offset`. + * + * For membership-probe builtins (all args ground), the generator returns + * at most one tuple. For enumeration over AlephZero relations the generator + * maps `offset` to the appropriate pair via a bijective enumeration scheme + * (e.g. Cantor pairing); callers must bound such scans with a TAKE node. + */ + struct NT_API ephemeral_object_type : object_type + { + enum class Cardinality { Finite, ConstrainedFinite, AlephZero, Continuum }; + + /** + * @brief Produces a page of tuples for the given bound arguments. + * @param args Bound argument values written by the JOIN before probing. + * @param offset Zero-based logical tuple offset (for pagination). + * @param limit Maximum number of tuples to return. + */ + using Generator = std::function<std::vector<Tuple>( + const std::vector<std::string>& args, + std::size_t offset, + std::size_t limit)>; + + Cardinality cardinality; + Generator generator; }; /** |
