9 #ifndef RMF_PUBLICATION_DECORATORS_H
10 #define RMF_PUBLICATION_DECORATORS_H
12 #include <RMF/config.h>
19 #include <RMF/internal/paths.h>
21 #include <boost/lexical_cast.hpp>
47 pubmed_id_(pubmed_id),
55 return get_node().get_value(title_);
56 } RMF_DECORATOR_CATCH( );
58 String get_frame_title()
const {
60 return get_node().get_frame_value(title_);
61 } RMF_DECORATOR_CATCH( );
63 String get_static_title()
const {
65 return get_node().get_static_value(title_);
66 } RMF_DECORATOR_CATCH( );
70 String get_journal()
const {
72 return get_node().get_value(journal_);
73 } RMF_DECORATOR_CATCH( );
75 String get_frame_journal()
const {
77 return get_node().get_frame_value(journal_);
78 } RMF_DECORATOR_CATCH( );
80 String get_static_journal()
const {
82 return get_node().get_static_value(journal_);
83 } RMF_DECORATOR_CATCH( );
87 String get_pubmed_id()
const {
89 return get_node().get_value(pubmed_id_);
90 } RMF_DECORATOR_CATCH( );
92 String get_frame_pubmed_id()
const {
94 return get_node().get_frame_value(pubmed_id_);
95 } RMF_DECORATOR_CATCH( );
97 String get_static_pubmed_id()
const {
99 return get_node().get_static_value(pubmed_id_);
100 } RMF_DECORATOR_CATCH( );
104 Int get_year()
const {
106 return get_node().get_value(year_);
107 } RMF_DECORATOR_CATCH( );
109 Int get_frame_year()
const {
111 return get_node().get_frame_value(year_);
112 } RMF_DECORATOR_CATCH( );
114 Int get_static_year()
const {
116 return get_node().get_static_value(year_);
117 } RMF_DECORATOR_CATCH( );
123 return get_node().get_value(authors_);
124 } RMF_DECORATOR_CATCH( );
126 Strings get_frame_authors()
const {
128 return get_node().get_frame_value(authors_);
129 } RMF_DECORATOR_CATCH( );
131 Strings get_static_authors()
const {
133 return get_node().get_static_value(authors_);
134 } RMF_DECORATOR_CATCH( );
137 static std::string get_decorator_type_name() {
138 return "JournalArticleConst";
160 void set_title(
String v) {
163 } RMF_DECORATOR_CATCH( );
165 void set_frame_title(
String v) {
168 } RMF_DECORATOR_CATCH( );
170 void set_static_title(
String v) {
173 } RMF_DECORATOR_CATCH( );
177 void set_journal(
String v) {
180 } RMF_DECORATOR_CATCH( );
182 void set_frame_journal(
String v) {
185 } RMF_DECORATOR_CATCH( );
187 void set_static_journal(
String v) {
190 } RMF_DECORATOR_CATCH( );
194 void set_pubmed_id(
String v) {
197 } RMF_DECORATOR_CATCH( );
199 void set_frame_pubmed_id(
String v) {
202 } RMF_DECORATOR_CATCH( );
204 void set_static_pubmed_id(
String v) {
207 } RMF_DECORATOR_CATCH( );
211 void set_year(
Int v) {
214 } RMF_DECORATOR_CATCH( );
216 void set_frame_year(
Int v) {
219 } RMF_DECORATOR_CATCH( );
221 void set_static_year(
Int v) {
224 } RMF_DECORATOR_CATCH( );
231 } RMF_DECORATOR_CATCH( );
233 void set_frame_authors(
Strings v) {
236 } RMF_DECORATOR_CATCH( );
238 void set_static_authors(
Strings v) {
241 } RMF_DECORATOR_CATCH( );
244 static std::string get_decorator_type_name() {
245 return "JournalArticle";
266 cat_(fh.get_category(
"publication")),
267 title_(fh.
get_key<StringTag>(cat_,
"title")), journal_(fh.
get_key<StringTag>(cat_,
"journal")), pubmed_id_(fh.
get_key<StringTag>(cat_,
"pubmed id")), year_(fh.
get_key<IntTag>(cat_,
"year")), authors_(fh.
get_key<StringsTag>(cat_,
"authors")) {
270 cat_(fh.get_category(
"publication")),
271 title_(fh.
get_key<StringTag>(cat_,
"title")), journal_(fh.
get_key<StringTag>(cat_,
"journal")), pubmed_id_(fh.
get_key<StringTag>(cat_,
"pubmed id")), year_(fh.
get_key<IntTag>(cat_,
"year")), authors_(fh.
get_key<StringsTag>(cat_,
"authors")) {
275 RMF_USAGE_CHECK((nh.get_type() ==
RMF::ORGANIZATIONAL), std::string(
"Bad node type. Got \"")
276 + boost::lexical_cast<std::string>(nh.get_type())
277 +
"\" in decorator type JournalArticle");
286 RMF_USAGE_CHECK((nh.get_type() ==
RMF::ORGANIZATIONAL), std::string(
"Bad node type. Got \"")
287 + boost::lexical_cast<std::string>(nh.get_type())
288 +
"\" in decorator type JournalArticle");
299 && !nh.get_value(title_).get_is_null();
303 && !nh.get_static_value(title_).get_is_null()
304 && !nh.get_static_value(journal_).get_is_null()
305 && !nh.get_static_value(pubmed_id_).get_is_null()
306 && !nh.get_static_value(year_).get_is_null()
307 && !nh.get_static_value(authors_).get_is_null();
309 RMF_SHOWABLE(JournalArticleFactory,
"JournalArticleFactory");
312 struct JournalArticleConstFactory:
public JournalArticleFactory {
313 JournalArticleConstFactory(FileConstHandle fh):
314 JournalArticleFactory(fh) {
316 JournalArticleConstFactory(FileHandle fh):
317 JournalArticleFactory(fh) {
Mostly empty base classes for decorators and factories.
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.
std::vector< String > Strings
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
bool get_is(NodeConstHandle nh) const
Various general useful macros for IMP.
const NodeType ORGANIZATIONAL
A node that is purely there for organizational purposes.
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.