This facade gives projects migrating from itage_engine a smaller first step.
It keeps the familiar Node, WriterBase, and ReaderBase shape while routing
the work through PuppetMaster's current RuntimeContext and transport
abstraction.
The facade lives under:
#include <puppet_master/compat/itage_facade.h>and uses the namespace:
namespace compat = puppet_master::compat::itage;The old code usually looked like this:
auto writer = node.CreateWriter("/vehicle/speed", nullptr, attribute);
writer->Write(&sample);
auto reader = node.CreateReader("/vehicle/speed", nullptr, attribute);
reader->SetCallBack([]() {});
reader->Read(&sample, time_diff);The compatibility facade keeps that shape:
compat::TopicOptions topic;
topic.message_type = "demo.SpeedSample";
topic.encoding = "application/x-struct";
topic.fixed_payload_size = sizeof(SpeedSample);
topic.message_policy.freshness = puppet_master::core::FreshnessPolicy::kQueued;
topic.message_policy.queue_depth = 4;
compat::Node node("legacy_speed_node");
auto reader = node.CreateReader("/vehicle/speed", topic);
auto writer = node.CreateWriter("/vehicle/speed", topic);
writer->Write(&sample);
reader->Read(&received, time_diff_ms);TopicOptions::fixed_payload_size is important when using the legacy
Write(&object) and Read(&object, time_diff) calls. The new transport layer is
byte-oriented, so the facade needs an explicit size for fixed-size payloads.
For variable-size payloads, use explicit lengths:
writer->Write(buffer.data(), buffer.size());
reader->Read(buffer.data(), buffer.size(), time_diff_ms);| itage_engine idea | Compatibility facade | New core underneath |
|---|---|---|
NodeBase |
compat::itage::NodeBase |
runtime::RuntimeContext |
CreateWriter(topic, data, attribute) |
same call shape | RuntimeContext::CreateWriter() |
CreateReader(topic, data, attribute) |
same call shape | RuntimeContext::CreateReader() |
WriterBase::Write(void*, len) |
same call shape | transport::Writer::Write(ByteView) |
ReaderBase::Read(void*, time_diff) |
same call shape for fixed-size payloads | transport::Reader::Read() |
| DDS-specific attribute | TopicOptions |
EndpointConfig and MessagePolicy |
The old API carried backend-specific data through void* attribute. This facade
keeps the slot, but the expected object is now compat::TopicOptions:
compat::TopicOptions topic;
topic.fixed_payload_size = sizeof(SpeedSample);
auto reader = node.CreateReader("/vehicle/speed", nullptr, &topic);
auto writer = node.CreateWriter("/vehicle/speed", nullptr, &topic);Do not pass the old DDS attribute structure directly. Convert it to
TopicOptions first so the migration remains transport-neutral.
- Replace old node creation with
compat::itage::Node. - Convert each old DDS/ZMQ/IPC attribute into
TopicOptions. - Add
fixed_payload_size = sizeof(T)for fixed-size struct messages. - Keep
Write(&msg)andRead(&msg, time_diff)temporarily. - Gradually move modules to
runtime::Component,ComponentSpec, and configuration-driven endpoints.
This facade is intentionally transitional:
- it does not expose FastDDS headers or DDS type support
- it treats messages as bytes or fixed-size structs
- it does not provide zero-copy loaned samples
- it does not replace the new component model or scheduler APIs
- unsafe
Read(void*, time_diff)requiresfixed_payload_size
New modules should prefer PuppetMaster's native runtime, component, configuration, and scheduler APIs. The facade is mainly for reducing migration friction in existing projects.