InstanceData Class Reference

The payload of one entity instance, in either ARON representation. More...

#include <RobotAPI/libraries/armem/core/Commit.h>

Public Member Functions

 InstanceData ()
 
 InstanceData (aron::data::DictPtr variant)
 Implicit by design, so that = {dto.toAron()} keeps working unchanged.
 
 InstanceData (aron::data::dto::DictPtr dto)
 Implicit by design, so that = {dto.toAronDTO()} reads the same way.
 
 InstanceData (const InstanceData &other)
 
 InstanceData (InstanceData &&other) noexcept
 
 operator bool () const
 Whether any data is held at all. Instance data may legitimately be null.
 
InstanceData & operator= (const InstanceData &other)
 
InstanceData & operator= (InstanceData &&other) noexcept
 
aron::data::dto::DictPtr toDTO () const
 The ice representation. Cheap in both cases: a variant keeps its ice object alive.
 
aron::data::DictPtr toVariant () const
 The variant representation.
 
 ~InstanceData ()
 

Detailed Description

The payload of one entity instance, in either ARON representation.

ARON data exists in two forms: the variant form (aron::data::Dict), which is a navigable object graph carrying paths, and the ice form (aron::data::dto::Dict), which is what actually goes over the wire.

Producing the variant form only to send it is pure overhead – it costs roughly a dozen heap allocations per ARON node and is then converted to ice by copying a pointer. Writers that do not need to navigate what they wrote can therefore hand over toAronDTO() instead of toAron() and skip building the graph.

This class accepts both implicitly, so existing call sites are unaffected and writers can be moved over one at a time.

Constructor & Destructor Documentation

◆ InstanceData() [1/5]

InstanceData ( )
default

◆ InstanceData() [2/5]

Implicit by design, so that = {dto.toAron()} keeps working unchanged.

◆ InstanceData() [3/5]

Implicit by design, so that = {dto.toAronDTO()} reads the same way.

◆ InstanceData() [4/5]

InstanceData ( const InstanceData & other)
default

◆ InstanceData() [5/5]

InstanceData ( InstanceData && other)
noexcept

◆ ~InstanceData()

~InstanceData ( )
default

Member Function Documentation

◆ operator bool()

operator bool ( ) const
explicit

Whether any data is held at all. Instance data may legitimately be null.

◆ operator=() [1/2]

InstanceData & operator= ( const InstanceData & other)
default

◆ operator=() [2/2]

InstanceData & operator= ( InstanceData && other)
noexcept

◆ toDTO()

aron::data::dto::DictPtr toDTO ( ) const

The ice representation. Cheap in both cases: a variant keeps its ice object alive.

◆ toVariant()

aron::data::DictPtr toVariant ( ) const

The variant representation.

Built on first use if this was constructed from the ice form, and cached afterwards.


The documentation for this class was generated from the following files: