Skip to content

Core and uprops

mutomuProps supplies the generic property, schema, event, and stream machinery. mutomCore adds the uLib scene object model, ownership, algorithms, persistence, data transport, and application-facing contexts.

Ownership and contexts

uLib::ObjectsContext owns the objects added through AddObject(). It is the single registry to observe for scene content; SmartPointer instances and reference ports may point to an object but do not replace this owner.

#include "Core/ObjectsContext.h"
#include "Math/ContainerBox.h"

uLib::ObjectsContext scene;
auto *box = new uLib::ContainerBox();
box->SetInstanceName("detector");
scene.AddObject(box);

for (const auto &holder : scene.GetObjects()) {
  if (holder) std::cout << holder->GetInstanceName() << "\n";
}

Object exposes the class and instance names, children/parent, owning context, property container, Updated(), and UpdateRequested(). ObjectFactory creates factory-registered scene types during restore; use a context to take ownership of what it creates.

Properties, reference ports, and actions

Use ULIB_PROPERTY for a stored parameter, then activate it in the constructor. A property change travels through the same metadata/event path whether it came from C++, a UI, a connection, a scene restore, or a remote client.

#include "Core/Object.h"
#include "Core/Property.h"

class Calibration final : public uLib::Object {
public:
  ULIB_PROPERTY(double, Gain, 1.0)

  Calibration() {
    ULIB_ACTIVATE_PROPERTIES(*this);
    Gain.SetRange(0.0, 100.0);
    Gain.SetUnits("1");
  }
};

Use a reference port when a port carries object identity, not a copy. Connect ports with ConnectFrom(); assigning a referenced object is not a lasting graph wire.

#include "Core/Property.h"

auto *input = dynamic_cast<uLib::ReferencePropertyBase *>(
    consumer->GetProperty("Input"));
auto *output = dynamic_cast<uLib::ReferencePropertyBase *>(
    producer->GetProperty("Output"));

if (input && output && input->CanConnectFrom(*output)) {
  input->ConnectFrom(*output);
}

AddReferencePort, AddValuePort, and AddActionPort build runtime ports owned by their object. ActionProperty is a zero-argument callable button/trigger; an action must not be serialized as state.

uLib::AddActionPort(
    box, "Reset", [box] { box->SetInstanceName("box"); },
    "Reset name", "Operation");

For custom computed storage, use FunctionalProperty or FunctionalReferenceProperty. The property's getter/setter should be the only way a graph writes that state.

Algorithms, data codecs, and persistence

Algorithm has synchronous Run() and lifecycle controls Start(), Pause(), Resume(), Stop(), Kill(), and Wait(). Derived algorithms inherit AutoRun, NumThreads, status, and input-object facilities.

DataSource is input bytes from a file or embedded buffer; DataSink is output bytes; DataBuffer is the conversion and stream queue node between graph objects. The source/sink classes are codec endpoints, not replacements for a live object stream.

#include "Core/DataSink.h"
#include "Core/DataSource.h"

uLib::DataSource source("calibration");
const char bytes[] = "gain=1.25";
source.SetData(bytes, sizeof(bytes) - 1);

uLib::DataSink sink("copy");
sink.WriteSource(&source);
sink.SaveToFile("calibration.txt");

SceneDocument, ObjectRecord, ReferenceRecord, ConnectionRecord, and layout records hold a complete scene state. ObjectCodec and the DecodeScope helper capture/restore objects and their references. ContextClient and ContextServer synchronize that model with a remote process.

uprops class catalog

Family Public primary classes/records Typical use
Property model PropertyContainer, PropertyBase, IProperty<T>, Property<T>, EnumProperty<T>, FunctionalProperty<T>, ActionProperty store a value, expose metadata, or make a port/action
Metadata/events PropertyMetadata, PropertySnapshot, ObjectSnapshot, PropertyChangePayload, IPropertySubscriber inspect or replicate a property change
Property backends IPropertyBackend, LocalSignalBackend, ScopedPublicationSuppression, RemoteBackendInterface, LoopbackBackend deliver property events locally or remotely
Type/schema TypeUri, TypeId, TypeMember, TypeDescriptor, TypeRegistry, SchemaId, SchemaValue, SchemaField, SchemaTable, Schema, SchemaRegistry describe a portable type or payload schema
Encoding DataFrame, EncodingId, IEncoder, IDecoder, IObjectEncoder, IObjectDecoder, BinaryEncoder, BinaryDecoder, ProtocolCodec, CodecRegistry encode a property/object frame
Optional transports PropertyServer, PropertyClient, FlatBuffersEncoder, FlatBuffersDecoder available when network/FlatBuffers support is enabled
Archives xml_iarchive, xml_oarchive, text_iarchive, text_oarchive, bin_iarchive, bin_oarchive, hrt_iarchive, hrt_oarchive, log_archive, schema_iarchive, schema_oarchive serialize values or walk a schema
Streams StreamProducer<T>, StreamActivator, ActivatableStream, WaitableStream<T>, StreamQueue<T>, StreamInput<T>, StreamOutput<T, ActivatorT> pull items or join a producer/consumer chain

The uprops enum vocabulary is PortDirection, PortAccess, ConnectionKind, PropertyEventKind, PropertyChangeOrigin, TypeForm, SchemaKind, and MessageKind. Their canonical names are used by C++, Python, the node graph, and remote protocol; do not create alternate spellings.

Core class catalog

Family Public primary classes/records Example entry point
Scene objects Object, ObjectsContext, ObjectFactory, ObjectCatalog, NodeGraphProp, PropertyBridge scene.AddObject(object)
Algorithms Algorithm, AlgorithmTask, Modifier, TransformModifier, EchoAlgorithm, DescribeAlgorithm, Recipe, RecipeDeclaration algorithm.Run()
Stream/data IStreamProducer, GenericStreamProducer, Collection<T>, DataCodec, DataEnvelope, DataSource, DataSink, DataBuffer producer.NextItem()
Scene state DocumentHeader, ReferenceRecord, ConnectionRecord, ObjectRecord, ViewportRecord, LayoutNode, LayoutRecord, SceneDocument, DecodeScope SaveScene(...) / restore utilities
Remote/runtime ContextClient, ContextServer, PythonPluginRegistry, UpdateScheduler, CoalescedCall context mirror or deferred update
Ownership/threading SmartPointer<T>, SmartArray<T, N>, Array<T, N>, Thread, Task, Team, Mutex, RecursiveMutex, ScopedTimedLock, Monitor context-owned object and task coordination
Serialization/utilities TypeId, TypeRegister, Timer, Options, Flags, CompressedWriter, CompressedReader, Debug, DebugAdapter, DebugAdapterText timer.Start()
Property templates Property<T>, EnumProperty, FunctionalProperty<T>, FunctionalEnumProperty, ReferencePropertyBase, TypedReferenceProperty<T>, ReferenceProperty<T>, FunctionalReferenceProperty<T> port.SetReferencedObject(target)

Small generic helpers such as Singleton<T>, StringReader, Serializable<T>, CommaInitializer, and type-introspection traits are installed header utilities. The complete header-to-type index is in Complete class catalog.