9 #ifndef RMF_FEATURE_DECORATORS_H
10 #define RMF_FEATURE_DECORATORS_H
12 #include <RMF/config.h>
19 #include <RMF/internal/paths.h>
21 #include <boost/lexical_cast.hpp>
41 Float get_score()
const {
43 return get_node().get_value(score_);
44 } RMF_DECORATOR_CATCH( );
46 Float get_frame_score()
const {
48 return get_node().get_frame_value(score_);
49 } RMF_DECORATOR_CATCH( );
51 Float get_static_score()
const {
53 return get_node().get_static_value(score_);
54 } RMF_DECORATOR_CATCH( );
57 static std::string get_decorator_type_name() {
60 RMF_SHOWABLE(
ScoreConst,
"Score: " << get_node());
72 void set_score(
Float v) {
75 } RMF_DECORATOR_CATCH( );
77 void set_frame_score(
Float v) {
80 } RMF_DECORATOR_CATCH( );
82 void set_static_score(
Float v) {
85 } RMF_DECORATOR_CATCH( );
88 static std::string get_decorator_type_name() {
102 cat_(fh.get_category(
"feature")),
103 score_(fh.
get_key<FloatTag>(cat_,
"score")) {
106 cat_(fh.get_category(
"feature")),
107 score_(fh.
get_key<FloatTag>(cat_,
"score")) {
111 RMF_USAGE_CHECK((nh.get_type() ==
RMF::FEATURE), std::string(
"Bad node type. Got \"")
112 + boost::lexical_cast<std::string>(nh.get_type())
113 +
"\" in decorator type Score");
118 RMF_USAGE_CHECK((nh.get_type() ==
RMF::FEATURE), std::string(
"Bad node type. Got \"")
119 + boost::lexical_cast<std::string>(nh.get_type())
120 +
"\" in decorator type Score");
121 return Score(nh, score_);
127 && !nh.get_value(score_).get_is_null();
131 && !nh.get_static_value(score_).get_is_null();
133 RMF_SHOWABLE(ScoreFactory,
"ScoreFactory");
136 struct ScoreConstFactory:
public ScoreFactory {
137 ScoreConstFactory(FileConstHandle fh):
140 ScoreConstFactory(FileHandle fh):
Mostly empty base classes for decorators and factories.
const NodeType FEATURE
Store information about some feature of the system.
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.
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.