9 #ifndef RMF_EXTERNAL_DECORATORS_H
10 #define RMF_EXTERNAL_DECORATORS_H
12 #include <RMF/config.h>
19 #include <RMF/internal/paths.h>
21 #include <boost/lexical_cast.hpp>
43 String relpath = get_node().get_value(path_);
44 String filename = get_node().get_file().get_path();
45 return internal::get_absolute_path(filename, relpath);
46 } RMF_DECORATOR_CATCH( );
49 static std::string get_decorator_type_name() {
50 return "ExternalConst";
64 void set_path(
String path) {
66 String filename = get_node().get_file().get_path();
67 String relpath = internal::get_relative_path(filename, path);
69 } RMF_DECORATOR_CATCH( );
72 static std::string get_decorator_type_name() {
86 cat_(fh.get_category(
"external")),
87 path_(fh.
get_key<StringTag>(cat_,
"path")) {
90 cat_(fh.get_category(
"external")),
91 path_(fh.
get_key<StringTag>(cat_,
"path")) {
95 RMF_USAGE_CHECK((nh.get_type() ==
RMF::REPRESENTATION), std::string(
"Bad node type. Got \"")
96 + boost::lexical_cast<std::string>(nh.get_type())
97 +
"\" in decorator type External");
102 RMF_USAGE_CHECK((nh.get_type() ==
RMF::REPRESENTATION), std::string(
"Bad node type. Got \"")
103 + boost::lexical_cast<std::string>(nh.get_type())
104 +
"\" in decorator type External");
111 && !nh.get_value(path_).get_is_null();
115 && !nh.get_static_value(path_).get_is_null();
117 RMF_SHOWABLE(ExternalFactory,
"ExternalFactory");
120 struct ExternalConstFactory:
public ExternalFactory {
121 ExternalConstFactory(FileConstHandle fh):
122 ExternalFactory(fh) {
124 ExternalConstFactory(FileHandle fh):
125 ExternalFactory(fh) {
Mostly empty base classes for decorators and factories.
const NodeType REPRESENTATION
Represent part of a molecule.
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.
bool get_is(NodeConstHandle nh) const
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.
ID< Tag > get_key(Category category, std::string name) const
Various general useful macros for IMP.