cortoproject / corto

A hierarchical object store for connecting realtime machine data with web applications, historians & more
https://www.corto.io
MIT License
87 stars 14 forks source link

Create objects recursively with declareChild and createChild #593

Closed SanderMertens closed 7 years ago

SanderMertens commented 7 years ago

When corto_declareChild or corto_createChild is called with a path expression, like foo/bar, the API will recursively create foo and bar with the specified type.

Example 1:

corto_declareChild(root_o, "foo/bar", corto_int32_o);
// 1. declare /foo
// 2. declare /bar

Example 2:

corto_createChild(root_o, "foo/bar", corto_int32_o);
// 1. declare /foo
// 2. declare /bar
// 3. define /foo
// 4. define /bar

When one of the steps fails, there will be no side effects (no objects will be left in the store). Additionally, in the case of corto_createChild, no DEFINE events will be generated if one of the objects fails to define.