1#ifndef SST_CORE_SERIALIZATION_OBJECTMAP_TREE_BUILDERS_H
2#define SST_CORE_SERIALIZATION_OBJECTMAP_TREE_BUILDERS_H
4#include "sst/core/serialization/ObjTreeLeaves.h"
5#include "sst/core/serialization/objectMap.h"
7namespace SST::Core::Serialization {
9template <
typename T,
typename REF,
typename PTYPE>
10SST::Core::Serialization::ObjTreeCont*
11ObjectMapFundamentalReference<T, REF, PTYPE>::buildTreeNode(
const std::string& name)
13 using namespace SST::Core::Serialization;
23 if constexpr ( std::is_same_v<T, bool> ) {
25 new BoolObj([proxy]()
mutable {
return static_cast<bool>(proxy); }, [proxy](
bool v)
mutable { proxy = v; });
27 else if constexpr ( std::is_integral_v<T> ) {
28 node =
new IntegerObj([proxy]()
mutable {
return static_cast<int64_t
>(
static_cast<T
>(proxy)); },
29 [proxy](int64_t v)
mutable { proxy =
static_cast<T
>(v); });
31 else if constexpr ( std::is_floating_point_v<T> ) {
32 node =
new FloatObj([proxy]()
mutable {
return static_cast<long double>(
static_cast<T
>(proxy)); },
33 [proxy](
long double v)
mutable { proxy =
static_cast<T
>(v); });
41 if ( this->isReadOnly() ) {
42 if (
auto* b =
dynamic_cast<BoolObj*
>(node) ) b->makeReadOnly();
43 if (
auto* i =
dynamic_cast<IntegerObj*
>(node) ) i->makeReadOnly();
44 if (
auto* f =
dynamic_cast<FloatObj*
>(node) ) f->makeReadOnly();
Definition ObjTreeLeaves.h:941
Definition ObjTreeLeaves.h:572
Definition ObjTreeLeaves.h:405
The Object Tree (ObjTree) is intended to be a developer friendly interface to SST’s existing serializ...
Definition ObjTreeLeaves.h:41
void setType(const std::string &type)
Set the type of the node - this comes from ObjectMap/Serialization.
Definition ObjTreeLeaves.h:124