Pteros  2.0
Molecular modeling library for human beings!
compiled_plugin_base.h
1 #ifndef COMPILED_PLUGIN_BASE_H
2 #define COMPILED_PLUGIN_BASE_H
3 
4 #include "pteros/analysis/consumer.h"
5 #include "pteros/analysis/trajectory_processor.h"
6 #include "boost/current_function.hpp"
7 
8 namespace pteros {
9 
10 struct Compiled_plugin_base: public Consumer {
11 
12  Compiled_plugin_base(Trajectory_processor* proc, const Options& opt): Consumer(proc){
13  options = opt;
14  }
15 
18  std::string label;
19 
20  virtual std::string help(){
21  return "\n\tThis plugin does not define any help information."
22  "\n\tDig into the sources. Good luck :)";
23  }
24 
25  void remove_jumps(Selection& sel, const Frame_info &info);
26 
27 protected:
29  Options options;
30 
32  virtual void pre_process_handler(){
33  try {
34  Consumer::pre_process_handler();
35  } catch(const Pteros_error& e){
36  std::cout << std::endl << "(ERROR) Compiled plugin method: '"
37  << BOOST_CURRENT_FUNCTION << "'" << std::endl;
38  std::cout << "(ERROR) in plugin instance: " << label << std::endl;
39  e.print();
40  exit(1);
41  }
42  }
43 
44  virtual void post_process_handler(const Frame_info &info){
45  try {
46  Consumer::post_process_handler(info);
47  } catch(const Pteros_error& e){
48  std::cout << std::endl << "(ERROR) Compiled plugin method: '"
49  << BOOST_CURRENT_FUNCTION << "'" << std::endl;
50  std::cout << "(ERROR) in plugin instance: " << label << std::endl;
51  e.print();
52  exit(1);
53  }
54  }
55 
56  virtual void process_frame_handler(const Frame_info &info){
57  try {
58  Consumer::process_frame_handler(info);
59  } catch(const Pteros_error& e){
60  std::cout << std::endl << "(ERROR) Compiled plugin method: '"
61  << BOOST_CURRENT_FUNCTION << "'" << std::endl;
62  std::cout << "(ERROR) Occured on frame " << info.valid_frame << std::endl;
63  std::cout << "(ERROR) in plugin instance: " << label << std::endl;
64  e.print();
65  exit(1);
66  }
67  }
68 
69 };
70 
71 }
72 
73 #endif
Pteros namespace.
Definition: options.cpp:32