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.

Definition at line 39 of file Commit.h.

Constructor & Destructor Documentation

◆ InstanceData() [1/5]

InstanceData ( )
default
+ Here is the caller graph for this function:

◆ InstanceData() [2/5]

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

Definition at line 34 of file Commit.cpp.

◆ InstanceData() [3/5]

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

Definition at line 38 of file Commit.cpp.

◆ InstanceData() [4/5]

InstanceData ( const InstanceData & other)
default
+ Here is the call graph for this function:

◆ InstanceData() [5/5]

InstanceData ( InstanceData && other)
noexcept

Definition at line 21 of file Commit.cpp.

+ Here is the call graph for this function:

◆ ~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.

Definition at line 65 of file Commit.cpp.

◆ operator=() [1/2]

InstanceData & operator= ( const InstanceData & other)
default
+ Here is the call graph for this function:

◆ operator=() [2/2]

InstanceData & operator= ( InstanceData && other)
noexcept

Definition at line 27 of file Commit.cpp.

+ Here is the call graph for this function:

◆ toDTO()

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

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

Definition at line 43 of file Commit.cpp.

◆ toVariant()

aron::data::DictPtr toVariant ( ) const

The variant representation.

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

Definition at line 55 of file Commit.cpp.

+ Here is the call graph for this function:

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