Templated Features¶
The catalogue of templated features shipped with kibo-template-viper —
what each one generates, in C++ and in Python. Use this page to pick the
features you need; pass each to Kibo via the -t flag (see the
Kibo usage guide).
C++ Templates¶
Templates in templates/cpp/ are organised by feature:
Core Types¶
Template |
Generated Files |
Purpose |
|---|---|---|
|
|
Type implementations for enum, struct, concept, club |
|
|
DSM definitions, paths, fields |
Persistence¶
Template |
Generated Files |
Purpose |
|---|---|---|
|
|
Attachment accessors |
|
|
SQLite persistence layer |
Serialization¶
Template |
Generated Files |
Purpose |
|---|---|---|
|
|
Binary encoder / decoder |
|
|
JSON encoder / decoder |
|
|
Bridge between static C++ and dynamic Viper values |
|
|
Content hashing for values |
|
|
Viper type mappings |
Function Pools¶
Template |
Generated Files |
Purpose |
|---|---|---|
|
|
Pure function bindings |
|
|
Remote function call API |
|
|
Stateful function bindings |
|
|
Remote stateful calls |
|
|
Pool exposing attachment API |
Python Integration (C++ side)¶
Template |
Generated Files |
Purpose |
|---|---|---|
|
|
Python module constants for types and paths |
Testing¶
Template |
Generated Files |
Purpose |
|---|---|---|
|
|
Random value generation |
|
|
Unit tests for fuzzing, JSON, streaming, storing |
|
|
Test application entry points |
Python Templates¶
Templates in templates/python/package/. All Python features are emitted
as a single Python package:
Template |
Generated File |
Purpose |
|---|---|---|
|
|
Package initialization |
|
|
Type definitions for Viper |
|
|
Classes for concepts, clubs, enums, structures |
|
|
Attachment API wrappers |
|
|
Database attachment API wrappers |
|
|
Field path constants |
|
|
Dynamic type definitions |
|
|
Function pool wrappers |
|
|
Stateful pool wrappers |
|
|
Remote function call wrappers |
|
|
Remote stateful call wrappers |
|
|
Minimal |
Picking a feature set¶
You don’t need every feature. Common selections by use case:
# Minimal — types only
templates = ['Data']
# Persistence (versioned data on disk)
templates = ['Model', 'Data', 'Attachments', 'Database']
# Full stack — types + persistence + serialization + RPC
templates = [
'Model', 'Data',
'Stream', 'Json',
'Attachments', 'Database',
'ValueType', 'ValueCodec', 'ValueHasher',
'FunctionPool', 'AttachmentFunctionPool',
]
# With testing
templates += ['Fuzz', 'Test', 'TestApp']
For invocation patterns, see Kibo usage.