9 #ifndef RMF_DECORATOR_REFERENCE_H
10 #define RMF_DECORATOR_REFERENCE_H
12 #include <RMF/config.h>
20 #include <boost/lexical_cast.hpp>
38 return get_node().get_file().
get_node(
39 NodeID(get_node().get_value(reference_)));
41 RMF_DECORATOR_CATCH();
45 return get_node().get_file().
get_node(
46 NodeID(get_node().get_frame_value(reference_)));
48 RMF_DECORATOR_CATCH();
52 return get_node().get_file().
get_node(
53 NodeID(get_node().get_static_value(reference_)));
55 RMF_DECORATOR_CATCH();
58 static std::string get_decorator_type_name() {
return "ReferenceConst"; }
72 return get_node().get_file().
get_node(
73 NodeID(get_node().get_value(reference_)));
75 RMF_DECORATOR_CATCH();
79 return get_node().get_file().
get_node(
80 NodeID(get_node().get_frame_value(reference_)));
82 RMF_DECORATOR_CATCH();
86 return get_node().get_file().
get_node(
87 NodeID(get_node().get_static_value(reference_)));
89 RMF_DECORATOR_CATCH();
96 RMF_DECORATOR_CATCH();
102 RMF_DECORATOR_CATCH();
108 RMF_DECORATOR_CATCH();
111 static std::string get_decorator_type_name() {
return "Reference"; }
122 : cat_(fh.get_category(
"sequence")),
123 reference_(fh.
get_key<IntTag>(cat_,
"reference")) {}
125 : cat_(fh.get_category(
"sequence")),
126 reference_(fh.
get_key<IntTag>(cat_,
"reference")) {}
130 std::string(
"Bad node type. Got \"") +
131 boost::lexical_cast<std::string>(nh.get_type()) +
132 "\" in decorator type Reference");
138 std::string(
"Bad node type. Got \"") +
139 boost::lexical_cast<std::string>(nh.get_type()) +
140 "\" in decorator type Reference");
147 !nh.get_value(reference_).get_is_null();
151 !nh.get_static_value(reference_).get_is_null();
153 RMF_SHOWABLE(ReferenceFactory,
"ReferenceFactory");
Mostly empty base classes for decorators and factories.
const NodeType REPRESENTATION
Represent part of a molecule.
bool get_is(NodeConstHandle nh) const
A handle for a particular node in the hierarchy.
The base class for decorators.
NodeType get_type() const
get the type of this node
A handle for a particular node in a read-only hierarchy.
A handle for a read-only RMF file.
void set_value(ID< Tag > k, typename Tag::ArgumentType v) const
A handle for an RMF file.
The base class for Factories.
Declaration for RMF::FileHandle.
Declaration of NodeHandle.
void set_static_value(ID< Tag > k, typename Tag::ArgumentType v) const
set the value of the attribute k for all frames.
ID< Tag > get_key(Category category, std::string name) const
Various general useful macros for IMP.
NodeHandle get_node(NodeID id) const
Return a NodeHandle from a NodeID.
void set_frame_value(ID< Tag > k, typename Tag::ArgumentType v) const
set the value of the attribute k for this node on the current frame.