g4tools  5.4.0
ifac
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_rroot_ifac
5 #define tools_rroot_ifac
6 
7 #include <string>
8 #include <map>
9 #include <ostream>
10 
11 namespace tools {
12 namespace rroot {
13  class iro;
14 }}
15 
16 namespace tools {
17 namespace rroot {
18 
19 class ifac {
20 public:
21  typedef std::map<char,void*> args;
22 public:
23  virtual ~ifac(){}
24 public:
25  virtual std::ostream& out() const = 0;
26  virtual iro* create(const std::string& a_class,const args&) = 0;
27 public:
28  static void* find_args(const args& a_args,char a_key) {
29  std::map<char,void*>::const_iterator it = a_args.find(a_key);
30  if(it==a_args.end()) return 0;
31  return (*it).second;
32  }
33  //static char arg_branch() {return 'B';}
34  static char arg_class() {return 'C';}
35 
36  static std::string* arg_class(const args& a_args) {
37  void* p = ifac::find_args(a_args,ifac::arg_class());
38  if(!p) return 0;
39  return (std::string*)p;
40  }
41 };
42 
43 }}
44 
45 #endif
tools::rroot::ifac::~ifac
virtual ~ifac()
Definition: ifac:23
tools::rroot::ifac::create
virtual iro * create(const std::string &a_class, const args &)=0
tools::rroot::ifac
Definition: ifac:19
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::rroot::ifac::arg_class
static std::string * arg_class(const args &a_args)
Definition: ifac:36
tools::rroot::ifac::arg_class
static char arg_class()
Definition: ifac:34
tools::rroot::iro
Definition: iro:19
tools::rroot::ifac::args
std::map< char, void * > args
Definition: ifac:21
tools::rroot::ifac::find_args
static void * find_args(const args &a_args, char a_key)
Definition: ifac:28
tools::rroot::ifac::out
virtual std::ostream & out() const =0