29class RepresentationConst :
public Decorator {
30 friend class RepresentationFactory;
31 friend class Representation;
34 std::vector<T> get_it(
const Ints &in)
const {
37 ret.push_back(get_node().get_file().get_node(
NodeID(i)));
43 : Decorator(nh), representation_(representation) {}
48 return get_it<NodeConstHandle>(get_node().get_value(representation_));
50 RMF_DECORATOR_CATCH();
54 return get_it<NodeConstHandle>(
55 get_node().get_frame_value(representation_));
57 RMF_DECORATOR_CATCH();
61 return get_it<NodeConstHandle>(
62 get_node().get_static_value(representation_));
64 RMF_DECORATOR_CATCH();
67 static std::string get_decorator_type_name() {
return "RepresentationConst"; }
71class Representation :
public RepresentationConst {
72 friend class RepresentationFactory;
74 : RepresentationConst(nh, representation) {}
77 Ints set_it(
const std::vector<T> &in)
const {
79 ret.reserve(in.size());
80 for(T n : in) { ret.push_back(n.get_id().get_index()); }
85 ret.reserve(in.size());
86 for(
NodeID n : in) { ret.push_back(n.get_index()); }
91#if !defined(SWIG) && !defined(IMP_DOXYGEN)
92 void set_representation(
Ints v) {
94 get_node().set_value(representation_, v);
96 RMF_DECORATOR_CATCH();
98 void set_frame_representation(
Ints v) {
100 get_node().set_frame_value(representation_, v);
102 RMF_DECORATOR_CATCH();
104 void set_static_representation(
Ints v) {
106 get_node().set_static_value(representation_, v);
108 RMF_DECORATOR_CATCH();
113 set_representation(set_it(v));
115 RMF_DECORATOR_CATCH();
119 set_frame_representation(set_it(v));
121 RMF_DECORATOR_CATCH();
125 set_static_representation(set_it(v));
127 RMF_DECORATOR_CATCH();
131 set_representation(set_it(v));
133 RMF_DECORATOR_CATCH();
135 void set_frame_representation(
const NodeHandles &v) {
137 set_frame_representation(set_it(v));
139 RMF_DECORATOR_CATCH();
141 void set_static_representation(
const NodeHandles &v) {
143 set_static_representation(set_it(v));
145 RMF_DECORATOR_CATCH();
148 void set_representation(
const NodeIDs &v) {
150 set_representation(set_it(v));
152 RMF_DECORATOR_CATCH();
154 void set_frame_representation(
const NodeIDs &v) {
156 set_frame_representation(set_it(v));
158 RMF_DECORATOR_CATCH();
160 void set_static_representation(
const NodeIDs &v) {
162 set_static_representation(set_it(v));
164 RMF_DECORATOR_CATCH();
169 return get_it<NodeHandle>(get_node().get_value(representation_));
171 RMF_DECORATOR_CATCH();
175 return get_it<NodeHandle>(get_node().get_frame_value(representation_));
177 RMF_DECORATOR_CATCH();
181 return get_it<NodeHandle>(get_node().get_static_value(representation_));
183 RMF_DECORATOR_CATCH();
186 static std::string get_decorator_type_name() {
return "Representation"; }