forked from sstsimulator/sst-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapper.cc
More file actions
83 lines (69 loc) · 1.74 KB
/
mapper.cc
File metadata and controls
83 lines (69 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2009-2025 NTESS. Under the terms
// of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Copyright (c) 2009-2025, NTESS
// All rights reserved.
//
// This file is part of the SST software package. For license
// information, see the LICENSE file in the top level directory of the
// distribution.
#include "sst_config.h"
#define SST_INCLUDING_SERIALIZER_H
#include "sst/core/serialization/impl/mapper.h"
#undef SST_INCLUDING_SERIALIZER_H
#include "sst/core/serialization/objectMap.h"
#include <iostream>
namespace SST::Core::Serialization::pvt {
void
ser_mapper::map_primitive(const std::string& name, ObjectMap* map)
{
obj_.back()->addVariable(name, map);
if ( next_item_read_only ) {
next_item_read_only = false;
map->setReadOnly();
}
}
void
ser_mapper::map_container(const std::string& name, ObjectMap* map)
{
obj_.back()->addVariable(name, map);
if ( next_item_read_only ) { next_item_read_only = false; }
}
void
ser_mapper::map_existing_object(const std::string& name, ObjectMap* map)
{
map->incRefCount();
obj_.back()->addVariable(name, map);
if ( next_item_read_only ) { next_item_read_only = false; }
}
void
ser_mapper::map_hierarchy_start(const std::string& name, ObjectMap* map)
{
obj_.back()->addVariable(name, map);
obj_.push_back(map);
indent++;
if ( next_item_read_only ) { next_item_read_only = false; }
}
void
ser_mapper::map_hierarchy_end()
{
obj_.pop_back();
indent--;
}
void
ser_mapper::init(ObjectMap* object)
{
obj_.push_back(object);
}
void
ser_mapper::reset()
{
obj_.clear();
}
void
ser_mapper::setNextObjectReadOnly()
{
next_item_read_only = true;
}
} // namespace SST::Core::Serialization::pvt