9#ifndef RMF_PROVENANCE_DECORATORS_H
10#define RMF_PROVENANCE_DECORATORS_H
12#include <RMF/config.h>
19#include <RMF/internal/paths.h>
21#include <boost/lexical_cast.hpp>
30 class StructureProvenanceConst:
public Decorator {
31 friend class StructureProvenanceFactory;
35IntKey structure_residue_offset_;
39IntKey structure_residue_offset):
41structure_filename_(structure_filename),
42structure_chain_(structure_chain),
43structure_residue_offset_(structure_residue_offset) {
47 String get_filename()
const {
49 String relpath = get_node().get_value(structure_filename_);
50 String filename = get_node().get_file().get_path();
51 return internal::get_absolute_path(filename, relpath);
52 } RMF_DECORATOR_CATCH( );
58 return get_node().get_value(structure_chain_);
59 } RMF_DECORATOR_CATCH( );
61 String get_frame_chain()
const {
63 return get_node().get_frame_value(structure_chain_);
64 } RMF_DECORATOR_CATCH( );
66 String get_static_chain()
const {
68 return get_node().get_static_value(structure_chain_);
69 } RMF_DECORATOR_CATCH( );
73 Int get_residue_offset()
const {
75 if (!get_node().get_has_value(structure_residue_offset_))
return 0;
76return get_node().get_value(structure_residue_offset_);
77 } RMF_DECORATOR_CATCH( );
79 Int get_frame_residue_offset()
const {
81 if (!get_node().get_has_value(structure_residue_offset_))
return 0;
82return get_node().get_frame_value(structure_residue_offset_);
83 } RMF_DECORATOR_CATCH( );
85 Int get_static_residue_offset()
const {
87 if (!get_node().get_has_value(structure_residue_offset_))
return 0;
88return get_node().get_static_value(structure_residue_offset_);
89 } RMF_DECORATOR_CATCH( );
92 static std::string get_decorator_type_name() {
93 return "StructureProvenanceConst";
95 RMF_SHOWABLE(StructureProvenanceConst,
"StructureProvenance: " << get_node());
99 class StructureProvenance:
public StructureProvenanceConst {
100 friend class StructureProvenanceFactory;
104IntKey structure_residue_offset):
105 StructureProvenanceConst(nh, structure_filename,
107structure_residue_offset) {
111 void set_filename(
String path) {
113 String filename = get_node().get_file().get_path();
114 String relpath = internal::get_relative_path(filename, path);
115 get_node().set_value(structure_filename_, relpath);
116 } RMF_DECORATOR_CATCH( );
120 void set_chain(
String v) {
122 get_node().set_value(structure_chain_, v);
123 } RMF_DECORATOR_CATCH( );
125 void set_frame_chain(
String v) {
127 get_node().set_frame_value(structure_chain_, v);
128 } RMF_DECORATOR_CATCH( );
130 void set_static_chain(
String v) {
132 get_node().set_static_value(structure_chain_, v);
133 } RMF_DECORATOR_CATCH( );
137 void set_residue_offset(
Int v) {
139 get_node().set_value(structure_residue_offset_, v);
140 } RMF_DECORATOR_CATCH( );
142 void set_frame_residue_offset(
Int v) {
144 get_node().set_frame_value(structure_residue_offset_, v);
145 } RMF_DECORATOR_CATCH( );
147 void set_static_residue_offset(
Int v) {
149 get_node().set_static_value(structure_residue_offset_, v);
150 } RMF_DECORATOR_CATCH( );
153 static std::string get_decorator_type_name() {
154 return "StructureProvenance";
161 class StructureProvenanceFactory:
public Factory {
165IntKey structure_residue_offset_;
171 cat_(fh.get_category(
"provenance")),
172 structure_filename_(fh.get_key<StringTag>(cat_,
"structure filename")), structure_chain_(fh.get_key<StringTag>(cat_,
"structure chain")), structure_residue_offset_(fh.get_key<IntTag>(cat_,
"structure residue offset")) {
175 cat_(fh.get_category(
"provenance")),
176 structure_filename_(fh.get_key<StringTag>(cat_,
"structure filename")), structure_chain_(fh.get_key<StringTag>(cat_,
"structure chain")), structure_residue_offset_(fh.get_key<IntTag>(cat_,
"structure residue offset")) {
181 + boost::lexical_cast<std::string>(nh.
get_type())
182 +
"\" in decorator type StructureProvenance");
185structure_residue_offset_);
190 + boost::lexical_cast<std::string>(nh.
get_type())
191 +
"\" in decorator type StructureProvenance");
194structure_residue_offset_);
200 && !nh.get_value(structure_filename_).get_is_null();
204 && !nh.get_static_value(structure_filename_).get_is_null()
205 && !nh.get_static_value(structure_chain_).get_is_null();
207 RMF_SHOWABLE(StructureProvenanceFactory,
"StructureProvenanceFactory");
210struct StructureProvenanceConstFactory:
public StructureProvenanceFactory {
211 StructureProvenanceConstFactory(FileConstHandle fh):
212 StructureProvenanceFactory(fh) {
214 StructureProvenanceConstFactory(FileHandle fh):
215 StructureProvenanceFactory(fh) {
226 class SampleProvenanceConst:
public Decorator {
227 friend class SampleProvenanceFactory;
231IntKey sampling_iterations_;
236IntKey sampling_iterations,
239sampling_method_(sampling_method),
240sampling_frames_(sampling_frames),
241sampling_iterations_(sampling_iterations),
242sampling_replicas_(sampling_replicas) {
246 String get_method()
const {
248 return get_node().get_value(sampling_method_);
249 } RMF_DECORATOR_CATCH( );
251 String get_frame_method()
const {
253 return get_node().get_frame_value(sampling_method_);
254 } RMF_DECORATOR_CATCH( );
256 String get_static_method()
const {
258 return get_node().get_static_value(sampling_method_);
259 } RMF_DECORATOR_CATCH( );
263 Int get_frames()
const {
265 return get_node().get_value(sampling_frames_);
266 } RMF_DECORATOR_CATCH( );
268 Int get_frame_frames()
const {
270 return get_node().get_frame_value(sampling_frames_);
271 } RMF_DECORATOR_CATCH( );
273 Int get_static_frames()
const {
275 return get_node().get_static_value(sampling_frames_);
276 } RMF_DECORATOR_CATCH( );
280 Int get_iterations()
const {
282 return get_node().get_value(sampling_iterations_);
283 } RMF_DECORATOR_CATCH( );
285 Int get_frame_iterations()
const {
287 return get_node().get_frame_value(sampling_iterations_);
288 } RMF_DECORATOR_CATCH( );
290 Int get_static_iterations()
const {
292 return get_node().get_static_value(sampling_iterations_);
293 } RMF_DECORATOR_CATCH( );
297 Int get_replicas()
const {
299 return get_node().get_value(sampling_replicas_);
300 } RMF_DECORATOR_CATCH( );
302 Int get_frame_replicas()
const {
304 return get_node().get_frame_value(sampling_replicas_);
305 } RMF_DECORATOR_CATCH( );
307 Int get_static_replicas()
const {
309 return get_node().get_static_value(sampling_replicas_);
310 } RMF_DECORATOR_CATCH( );
313 static std::string get_decorator_type_name() {
314 return "SampleProvenanceConst";
316 RMF_SHOWABLE(SampleProvenanceConst,
"SampleProvenance: " << get_node());
320 class SampleProvenance:
public SampleProvenanceConst {
321 friend class SampleProvenanceFactory;
325IntKey sampling_iterations,
327 SampleProvenanceConst(nh, sampling_method,
334 void set_method(
String v) {
336 get_node().set_value(sampling_method_, v);
337 } RMF_DECORATOR_CATCH( );
339 void set_frame_method(
String v) {
341 get_node().set_frame_value(sampling_method_, v);
342 } RMF_DECORATOR_CATCH( );
344 void set_static_method(
String v) {
346 get_node().set_static_value(sampling_method_, v);
347 } RMF_DECORATOR_CATCH( );
351 void set_frames(
Int v) {
353 get_node().set_value(sampling_frames_, v);
354 } RMF_DECORATOR_CATCH( );
356 void set_frame_frames(
Int v) {
358 get_node().set_frame_value(sampling_frames_, v);
359 } RMF_DECORATOR_CATCH( );
361 void set_static_frames(
Int v) {
363 get_node().set_static_value(sampling_frames_, v);
364 } RMF_DECORATOR_CATCH( );
368 void set_iterations(
Int v) {
370 get_node().set_value(sampling_iterations_, v);
371 } RMF_DECORATOR_CATCH( );
373 void set_frame_iterations(
Int v) {
375 get_node().set_frame_value(sampling_iterations_, v);
376 } RMF_DECORATOR_CATCH( );
378 void set_static_iterations(
Int v) {
380 get_node().set_static_value(sampling_iterations_, v);
381 } RMF_DECORATOR_CATCH( );
385 void set_replicas(
Int v) {
387 get_node().set_value(sampling_replicas_, v);
388 } RMF_DECORATOR_CATCH( );
390 void set_frame_replicas(
Int v) {
392 get_node().set_frame_value(sampling_replicas_, v);
393 } RMF_DECORATOR_CATCH( );
395 void set_static_replicas(
Int v) {
397 get_node().set_static_value(sampling_replicas_, v);
398 } RMF_DECORATOR_CATCH( );
401 static std::string get_decorator_type_name() {
402 return "SampleProvenance";
409 class SampleProvenanceFactory:
public Factory {
413IntKey sampling_iterations_;
421 cat_(fh.get_category(
"provenance")),
422 sampling_method_(fh.get_key<StringTag>(cat_,
"sampling method")), sampling_frames_(fh.get_key<IntTag>(cat_,
"sampling frames")), sampling_iterations_(fh.get_key<IntTag>(cat_,
"sampling iterations")), sampling_replicas_(fh.get_key<IntTag>(cat_,
"sampling replicas")) {
425 cat_(fh.get_category(
"provenance")),
426 sampling_method_(fh.get_key<StringTag>(cat_,
"sampling method")), sampling_frames_(fh.get_key<IntTag>(cat_,
"sampling frames")), sampling_iterations_(fh.get_key<IntTag>(cat_,
"sampling iterations")), sampling_replicas_(fh.get_key<IntTag>(cat_,
"sampling replicas")) {
431 + boost::lexical_cast<std::string>(nh.
get_type())
432 +
"\" in decorator type SampleProvenance");
441 + boost::lexical_cast<std::string>(nh.
get_type())
442 +
"\" in decorator type SampleProvenance");
452 && !nh.get_value(sampling_method_).get_is_null();
456 && !nh.get_static_value(sampling_method_).get_is_null()
457 && !nh.get_static_value(sampling_frames_).get_is_null()
458 && !nh.get_static_value(sampling_iterations_).get_is_null()
459 && !nh.get_static_value(sampling_replicas_).get_is_null();
461 RMF_SHOWABLE(SampleProvenanceFactory,
"SampleProvenanceFactory");
464struct SampleProvenanceConstFactory:
public SampleProvenanceFactory {
465 SampleProvenanceConstFactory(FileConstHandle fh):
466 SampleProvenanceFactory(fh) {
468 SampleProvenanceConstFactory(FileHandle fh):
469 SampleProvenanceFactory(fh) {
480 class CombineProvenanceConst:
public Decorator {
481 friend class CombineProvenanceFactory;
489combined_runs_(combined_runs),
490combined_frames_(combined_frames) {
494 Int get_runs()
const {
496 return get_node().get_value(combined_runs_);
497 } RMF_DECORATOR_CATCH( );
499 Int get_frame_runs()
const {
501 return get_node().get_frame_value(combined_runs_);
502 } RMF_DECORATOR_CATCH( );
504 Int get_static_runs()
const {
506 return get_node().get_static_value(combined_runs_);
507 } RMF_DECORATOR_CATCH( );
511 Int get_frames()
const {
513 return get_node().get_value(combined_frames_);
514 } RMF_DECORATOR_CATCH( );
516 Int get_frame_frames()
const {
518 return get_node().get_frame_value(combined_frames_);
519 } RMF_DECORATOR_CATCH( );
521 Int get_static_frames()
const {
523 return get_node().get_static_value(combined_frames_);
524 } RMF_DECORATOR_CATCH( );
527 static std::string get_decorator_type_name() {
528 return "CombineProvenanceConst";
530 RMF_SHOWABLE(CombineProvenanceConst,
"CombineProvenance: " << get_node());
534 class CombineProvenance:
public CombineProvenanceConst {
535 friend class CombineProvenanceFactory;
539 CombineProvenanceConst(nh, combined_runs,
544 void set_runs(
Int v) {
546 get_node().set_value(combined_runs_, v);
547 } RMF_DECORATOR_CATCH( );
549 void set_frame_runs(
Int v) {
551 get_node().set_frame_value(combined_runs_, v);
552 } RMF_DECORATOR_CATCH( );
554 void set_static_runs(
Int v) {
556 get_node().set_static_value(combined_runs_, v);
557 } RMF_DECORATOR_CATCH( );
561 void set_frames(
Int v) {
563 get_node().set_value(combined_frames_, v);
564 } RMF_DECORATOR_CATCH( );
566 void set_frame_frames(
Int v) {
568 get_node().set_frame_value(combined_frames_, v);
569 } RMF_DECORATOR_CATCH( );
571 void set_static_frames(
Int v) {
573 get_node().set_static_value(combined_frames_, v);
574 } RMF_DECORATOR_CATCH( );
577 static std::string get_decorator_type_name() {
578 return "CombineProvenance";
585 class CombineProvenanceFactory:
public Factory {
593 cat_(fh.get_category(
"provenance")),
594 combined_runs_(fh.get_key<IntTag>(cat_,
"combined runs")), combined_frames_(fh.get_key<IntTag>(cat_,
"combined frames")) {
597 cat_(fh.get_category(
"provenance")),
598 combined_runs_(fh.get_key<IntTag>(cat_,
"combined runs")), combined_frames_(fh.get_key<IntTag>(cat_,
"combined frames")) {
603 + boost::lexical_cast<std::string>(nh.
get_type())
604 +
"\" in decorator type CombineProvenance");
611 + boost::lexical_cast<std::string>(nh.
get_type())
612 +
"\" in decorator type CombineProvenance");
620 && !nh.get_value(combined_runs_).get_is_null();
624 && !nh.get_static_value(combined_runs_).get_is_null()
625 && !nh.get_static_value(combined_frames_).get_is_null();
627 RMF_SHOWABLE(CombineProvenanceFactory,
"CombineProvenanceFactory");
630struct CombineProvenanceConstFactory:
public CombineProvenanceFactory {
631 CombineProvenanceConstFactory(FileConstHandle fh):
632 CombineProvenanceFactory(fh) {
634 CombineProvenanceConstFactory(FileHandle fh):
635 CombineProvenanceFactory(fh) {
646 class FilterProvenanceConst:
public Decorator {
647 friend class FilterProvenanceFactory;
657filter_method_(filter_method),
658filter_threshold_(filter_threshold),
659filter_frames_(filter_frames) {
663 String get_method()
const {
665 return get_node().get_value(filter_method_);
666 } RMF_DECORATOR_CATCH( );
668 String get_frame_method()
const {
670 return get_node().get_frame_value(filter_method_);
671 } RMF_DECORATOR_CATCH( );
673 String get_static_method()
const {
675 return get_node().get_static_value(filter_method_);
676 } RMF_DECORATOR_CATCH( );
680 Float get_threshold()
const {
682 return get_node().get_value(filter_threshold_);
683 } RMF_DECORATOR_CATCH( );
685 Float get_frame_threshold()
const {
687 return get_node().get_frame_value(filter_threshold_);
688 } RMF_DECORATOR_CATCH( );
690 Float get_static_threshold()
const {
692 return get_node().get_static_value(filter_threshold_);
693 } RMF_DECORATOR_CATCH( );
697 Int get_frames()
const {
699 return get_node().get_value(filter_frames_);
700 } RMF_DECORATOR_CATCH( );
702 Int get_frame_frames()
const {
704 return get_node().get_frame_value(filter_frames_);
705 } RMF_DECORATOR_CATCH( );
707 Int get_static_frames()
const {
709 return get_node().get_static_value(filter_frames_);
710 } RMF_DECORATOR_CATCH( );
713 static std::string get_decorator_type_name() {
714 return "FilterProvenanceConst";
716 RMF_SHOWABLE(FilterProvenanceConst,
"FilterProvenance: " << get_node());
720 class FilterProvenance:
public FilterProvenanceConst {
721 friend class FilterProvenanceFactory;
726 FilterProvenanceConst(nh, filter_method,
732 void set_method(
String v) {
734 get_node().set_value(filter_method_, v);
735 } RMF_DECORATOR_CATCH( );
737 void set_frame_method(
String v) {
739 get_node().set_frame_value(filter_method_, v);
740 } RMF_DECORATOR_CATCH( );
742 void set_static_method(
String v) {
744 get_node().set_static_value(filter_method_, v);
745 } RMF_DECORATOR_CATCH( );
749 void set_threshold(
Float v) {
751 get_node().set_value(filter_threshold_, v);
752 } RMF_DECORATOR_CATCH( );
754 void set_frame_threshold(
Float v) {
756 get_node().set_frame_value(filter_threshold_, v);
757 } RMF_DECORATOR_CATCH( );
759 void set_static_threshold(
Float v) {
761 get_node().set_static_value(filter_threshold_, v);
762 } RMF_DECORATOR_CATCH( );
766 void set_frames(
Int v) {
768 get_node().set_value(filter_frames_, v);
769 } RMF_DECORATOR_CATCH( );
771 void set_frame_frames(
Int v) {
773 get_node().set_frame_value(filter_frames_, v);
774 } RMF_DECORATOR_CATCH( );
776 void set_static_frames(
Int v) {
778 get_node().set_static_value(filter_frames_, v);
779 } RMF_DECORATOR_CATCH( );
782 static std::string get_decorator_type_name() {
783 return "FilterProvenance";
790 class FilterProvenanceFactory:
public Factory {
800 cat_(fh.get_category(
"provenance")),
801 filter_method_(fh.get_key<StringTag>(cat_,
"filter method")), filter_threshold_(fh.get_key<FloatTag>(cat_,
"filter threshold")), filter_frames_(fh.get_key<IntTag>(cat_,
"filter frames")) {
804 cat_(fh.get_category(
"provenance")),
805 filter_method_(fh.get_key<StringTag>(cat_,
"filter method")), filter_threshold_(fh.get_key<FloatTag>(cat_,
"filter threshold")), filter_frames_(fh.get_key<IntTag>(cat_,
"filter frames")) {
810 + boost::lexical_cast<std::string>(nh.
get_type())
811 +
"\" in decorator type FilterProvenance");
819 + boost::lexical_cast<std::string>(nh.
get_type())
820 +
"\" in decorator type FilterProvenance");
829 && !nh.get_value(filter_method_).get_is_null();
833 && !nh.get_static_value(filter_method_).get_is_null()
834 && !nh.get_static_value(filter_threshold_).get_is_null()
835 && !nh.get_static_value(filter_frames_).get_is_null();
837 RMF_SHOWABLE(FilterProvenanceFactory,
"FilterProvenanceFactory");
840struct FilterProvenanceConstFactory:
public FilterProvenanceFactory {
841 FilterProvenanceConstFactory(FileConstHandle fh):
842 FilterProvenanceFactory(fh) {
844 FilterProvenanceConstFactory(FileHandle fh):
845 FilterProvenanceFactory(fh) {
856 class ClusterProvenanceConst:
public Decorator {
857 friend class ClusterProvenanceFactory;
867cluster_members_(cluster_members),
868cluster_precision_(cluster_precision),
869cluster_density_(cluster_density) {
873 Int get_members()
const {
875 return get_node().get_value(cluster_members_);
876 } RMF_DECORATOR_CATCH( );
878 Int get_frame_members()
const {
880 return get_node().get_frame_value(cluster_members_);
881 } RMF_DECORATOR_CATCH( );
883 Int get_static_members()
const {
885 return get_node().get_static_value(cluster_members_);
886 } RMF_DECORATOR_CATCH( );
890 Float get_precision()
const {
892 if (!get_node().get_has_value(cluster_precision_))
return 0.0;
893return get_node().get_value(cluster_precision_);
894 } RMF_DECORATOR_CATCH( );
896 Float get_frame_precision()
const {
898 if (!get_node().get_has_value(cluster_precision_))
return 0.0;
899return get_node().get_frame_value(cluster_precision_);
900 } RMF_DECORATOR_CATCH( );
902 Float get_static_precision()
const {
904 if (!get_node().get_has_value(cluster_precision_))
return 0.0;
905return get_node().get_static_value(cluster_precision_);
906 } RMF_DECORATOR_CATCH( );
910 String get_density()
const {
912 if (!get_node().get_has_value(cluster_density_)) {
915 String relpath = get_node().get_value(cluster_density_);
916 String filename = get_node().get_file().get_path();
917 return internal::get_absolute_path(filename, relpath);
919 } RMF_DECORATOR_CATCH( );
922 static std::string get_decorator_type_name() {
923 return "ClusterProvenanceConst";
925 RMF_SHOWABLE(ClusterProvenanceConst,
"ClusterProvenance: " << get_node());
929 class ClusterProvenance:
public ClusterProvenanceConst {
930 friend class ClusterProvenanceFactory;
935 ClusterProvenanceConst(nh, cluster_members,
941 void set_members(
Int v) {
943 get_node().set_value(cluster_members_, v);
944 } RMF_DECORATOR_CATCH( );
946 void set_frame_members(
Int v) {
948 get_node().set_frame_value(cluster_members_, v);
949 } RMF_DECORATOR_CATCH( );
951 void set_static_members(
Int v) {
953 get_node().set_static_value(cluster_members_, v);
954 } RMF_DECORATOR_CATCH( );
958 void set_precision(
Float v) {
960 get_node().set_value(cluster_precision_, v);
961 } RMF_DECORATOR_CATCH( );
963 void set_frame_precision(
Float v) {
965 get_node().set_frame_value(cluster_precision_, v);
966 } RMF_DECORATOR_CATCH( );
968 void set_static_precision(
Float v) {
970 get_node().set_static_value(cluster_precision_, v);
971 } RMF_DECORATOR_CATCH( );
975 void set_density(
String path) {
978 get_node().set_value(cluster_density_, path);
980 String filename = get_node().get_file().get_path();
981 String relpath = internal::get_relative_path(filename, path);
982 get_node().set_value(cluster_density_, relpath);
984 } RMF_DECORATOR_CATCH( );
987 static std::string get_decorator_type_name() {
988 return "ClusterProvenance";
995 class ClusterProvenanceFactory:
public Factory {
1005 cat_(fh.get_category(
"provenance")),
1006 cluster_members_(fh.get_key<IntTag>(cat_,
"cluster members")), cluster_precision_(fh.get_key<FloatTag>(cat_,
"cluster precision")), cluster_density_(fh.get_key<StringTag>(cat_,
"cluster density")) {
1009 cat_(fh.get_category(
"provenance")),
1010 cluster_members_(fh.get_key<IntTag>(cat_,
"cluster members")), cluster_precision_(fh.get_key<FloatTag>(cat_,
"cluster precision")), cluster_density_(fh.get_key<StringTag>(cat_,
"cluster density")) {
1015 + boost::lexical_cast<std::string>(nh.
get_type())
1016 +
"\" in decorator type ClusterProvenance");
1024 + boost::lexical_cast<std::string>(nh.
get_type())
1025 +
"\" in decorator type ClusterProvenance");
1034 && !nh.get_value(cluster_members_).get_is_null();
1038 && !nh.get_static_value(cluster_members_).get_is_null()
1039 && !nh.get_static_value(cluster_density_).get_is_null();
1041 RMF_SHOWABLE(ClusterProvenanceFactory,
"ClusterProvenanceFactory");
1044struct ClusterProvenanceConstFactory:
public ClusterProvenanceFactory {
1045 ClusterProvenanceConstFactory(FileConstHandle fh):
1046 ClusterProvenanceFactory(fh) {
1048 ClusterProvenanceConstFactory(FileHandle fh):
1049 ClusterProvenanceFactory(fh) {
1060 class ScriptProvenanceConst:
public Decorator {
1061 friend class ScriptProvenanceFactory;
1067script_filename_(script_filename) {
1071 String get_filename()
const {
1073 String relpath = get_node().get_value(script_filename_);
1074 String filename = get_node().get_file().get_path();
1075 return internal::get_absolute_path(filename, relpath);
1076 } RMF_DECORATOR_CATCH( );
1079 static std::string get_decorator_type_name() {
1080 return "ScriptProvenanceConst";
1082 RMF_SHOWABLE(ScriptProvenanceConst,
"ScriptProvenance: " << get_node());
1086 class ScriptProvenance:
public ScriptProvenanceConst {
1087 friend class ScriptProvenanceFactory;
1090 ScriptProvenanceConst(nh, script_filename) {
1094 void set_filename(
String path) {
1096 String filename = get_node().get_file().get_path();
1097 String relpath = internal::get_relative_path(filename, path);
1098 get_node().set_value(script_filename_, relpath);
1099 } RMF_DECORATOR_CATCH( );
1102 static std::string get_decorator_type_name() {
1103 return "ScriptProvenance";
1116 cat_(fh.get_category(
"provenance")),
1117 script_filename_(fh.get_key<StringTag>(cat_,
"script filename")) {
1120 cat_(fh.get_category(
"provenance")),
1121 script_filename_(fh.get_key<StringTag>(cat_,
"script filename")) {
1126 + boost::lexical_cast<std::string>(nh.
get_type())
1127 +
"\" in decorator type ScriptProvenance");
1133 + boost::lexical_cast<std::string>(nh.
get_type())
1134 +
"\" in decorator type ScriptProvenance");
1141 && !nh.get_value(script_filename_).get_is_null();
1145 && !nh.get_static_value(script_filename_).get_is_null();
1147 RMF_SHOWABLE(ScriptProvenanceFactory,
"ScriptProvenanceFactory");
1150struct ScriptProvenanceConstFactory:
public ScriptProvenanceFactory {
1151 ScriptProvenanceConstFactory(FileConstHandle fh):
1152 ScriptProvenanceFactory(fh) {
1154 ScriptProvenanceConstFactory(FileHandle fh):
1155 ScriptProvenanceFactory(fh) {
1166 class SoftwareProvenanceConst:
public Decorator {
1167 friend class SoftwareProvenanceFactory;
1177software_name_(software_name),
1178software_version_(software_version),
1179software_location_(software_location) {
1183 String get_name()
const {
1185 return get_node().get_value(software_name_);
1186 } RMF_DECORATOR_CATCH( );
1188 String get_frame_name()
const {
1190 return get_node().get_frame_value(software_name_);
1191 } RMF_DECORATOR_CATCH( );
1193 String get_static_name()
const {
1195 return get_node().get_static_value(software_name_);
1196 } RMF_DECORATOR_CATCH( );
1200 String get_version()
const {
1202 return get_node().get_value(software_version_);
1203 } RMF_DECORATOR_CATCH( );
1205 String get_frame_version()
const {
1207 return get_node().get_frame_value(software_version_);
1208 } RMF_DECORATOR_CATCH( );
1210 String get_static_version()
const {
1212 return get_node().get_static_value(software_version_);
1213 } RMF_DECORATOR_CATCH( );
1217 String get_location()
const {
1219 return get_node().get_value(software_location_);
1220 } RMF_DECORATOR_CATCH( );
1222 String get_frame_location()
const {
1224 return get_node().get_frame_value(software_location_);
1225 } RMF_DECORATOR_CATCH( );
1227 String get_static_location()
const {
1229 return get_node().get_static_value(software_location_);
1230 } RMF_DECORATOR_CATCH( );
1233 static std::string get_decorator_type_name() {
1234 return "SoftwareProvenanceConst";
1236 RMF_SHOWABLE(SoftwareProvenanceConst,
"SoftwareProvenance: " << get_node());
1240 class SoftwareProvenance:
public SoftwareProvenanceConst {
1241 friend class SoftwareProvenanceFactory;
1246 SoftwareProvenanceConst(nh, software_name,
1252 void set_name(
String v) {
1254 get_node().set_value(software_name_, v);
1255 } RMF_DECORATOR_CATCH( );
1257 void set_frame_name(
String v) {
1259 get_node().set_frame_value(software_name_, v);
1260 } RMF_DECORATOR_CATCH( );
1262 void set_static_name(
String v) {
1264 get_node().set_static_value(software_name_, v);
1265 } RMF_DECORATOR_CATCH( );
1269 void set_version(
String v) {
1271 get_node().set_value(software_version_, v);
1272 } RMF_DECORATOR_CATCH( );
1274 void set_frame_version(
String v) {
1276 get_node().set_frame_value(software_version_, v);
1277 } RMF_DECORATOR_CATCH( );
1279 void set_static_version(
String v) {
1281 get_node().set_static_value(software_version_, v);
1282 } RMF_DECORATOR_CATCH( );
1286 void set_location(
String v) {
1288 get_node().set_value(software_location_, v);
1289 } RMF_DECORATOR_CATCH( );
1291 void set_frame_location(
String v) {
1293 get_node().set_frame_value(software_location_, v);
1294 } RMF_DECORATOR_CATCH( );
1296 void set_static_location(
String v) {
1298 get_node().set_static_value(software_location_, v);
1299 } RMF_DECORATOR_CATCH( );
1302 static std::string get_decorator_type_name() {
1303 return "SoftwareProvenance";
1320 cat_(fh.get_category(
"provenance")),
1321 software_name_(fh.get_key<StringTag>(cat_,
"software name")), software_version_(fh.get_key<StringTag>(cat_,
"software version")), software_location_(fh.get_key<StringTag>(cat_,
"software location")) {
1324 cat_(fh.get_category(
"provenance")),
1325 software_name_(fh.get_key<StringTag>(cat_,
"software name")), software_version_(fh.get_key<StringTag>(cat_,
"software version")), software_location_(fh.get_key<StringTag>(cat_,
"software location")) {
1330 + boost::lexical_cast<std::string>(nh.
get_type())
1331 +
"\" in decorator type SoftwareProvenance");
1339 + boost::lexical_cast<std::string>(nh.
get_type())
1340 +
"\" in decorator type SoftwareProvenance");
1349 && !nh.get_value(software_name_).get_is_null();
1353 && !nh.get_static_value(software_name_).get_is_null()
1354 && !nh.get_static_value(software_version_).get_is_null()
1355 && !nh.get_static_value(software_location_).get_is_null();
1357 RMF_SHOWABLE(SoftwareProvenanceFactory,
"SoftwareProvenanceFactory");
1360struct SoftwareProvenanceConstFactory:
public SoftwareProvenanceFactory {
1361 SoftwareProvenanceConstFactory(FileConstHandle fh):
1362 SoftwareProvenanceFactory(fh) {
1364 SoftwareProvenanceConstFactory(FileHandle fh):
1365 SoftwareProvenanceFactory(fh) {
Mostly empty base classes for decorators and factories.
Declaration for RMF::FileHandle.
Declaration of NodeHandle.
The base class for Factories.
A handle for a read-only RMF file.
A handle for an RMF file.
A handle for a particular node in a read-only hierarchy.
NodeType get_type() const
get the type of this node
A handle for a particular node in the hierarchy.
ClusterProvenance get(NodeHandle nh) const
ClusterProvenanceConst get(NodeConstHandle nh) const
bool get_is(NodeConstHandle nh) const
bool get_is(NodeConstHandle nh) const
CombineProvenanceConst get(NodeConstHandle nh) const
CombineProvenance get(NodeHandle nh) const
FilterProvenance get(NodeHandle nh) const
bool get_is(NodeConstHandle nh) const
FilterProvenanceConst get(NodeConstHandle nh) const
SampleProvenanceConst get(NodeConstHandle nh) const
bool get_is(NodeConstHandle nh) const
SampleProvenance get(NodeHandle nh) const
bool get_is(NodeConstHandle nh) const
ScriptProvenance get(NodeHandle nh) const
ScriptProvenanceConst get(NodeConstHandle nh) const
SoftwareProvenanceConst get(NodeConstHandle nh) const
SoftwareProvenance get(NodeHandle nh) const
bool get_is(NodeConstHandle nh) const
StructureProvenance get(NodeHandle nh) const
bool get_is(NodeConstHandle nh) const
StructureProvenanceConst get(NodeConstHandle nh) const
Various general useful macros for IMP.
See Decorators and Attributes for more information.
The namespace for all functionality in the library.
ID< StringTag > StringKey
const NodeType PROVENANCE
Represent the process by which a structure was created.
ID< CategoryTag > Category