Gaudi Framework, version v25r0

Home   Generated: Mon Feb 17 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IoComponentMgr.h
Go to the documentation of this file.
1 
2 // IoComponentMgr.h
3 // Header file for class IoComponentMgr
4 // Author: S.Binet<binet@cern.ch>
6 #ifndef GAUDIMP_IOCOMPONENTMGR_H
7 #define GAUDIMP_IOCOMPONENTMGR_H 1
8 
9 // Python includes
10 #include <Python.h>
11 
12 // STL includes
13 #include <string>
14 #include <map>
15 #include <list>
16 
17 // FrameWork includes
18 #include "GaudiKernel/Service.h"
19 
20 // GaudiKernel
24 
25 // Forward declaration
26 class ISvcLocator;
27 
28 class IoComponentMgr: public extends2<Service, IIoComponentMgr,
29  IIncidentListener> {
31  // Public methods:
33  public:
34 
35  // Copy constructor:
36 
38  IoComponentMgr( const std::string& name, ISvcLocator* pSvcLocator );
39 
41  virtual ~IoComponentMgr();
42 
43  // Assignment operator:
44  //IoComponentMgr &operator=(const IoComponentMgr &alg);
45 
47 
48  virtual StatusCode initialize();
49  virtual StatusCode finalize();
50 
52 
53  void handle(const Incident&);
54 
56  // Const methods:
58 
61  virtual
62  bool io_hasitem (IIoComponent* iocomponent) const;
63 
67  virtual
68  bool io_contains (IIoComponent* iocomponent,
69  const std::string& fname) const;
70 
72  // Non-const methods:
74 
81  virtual
82  StatusCode io_register (IIoComponent* iocomponent);
83 
90  virtual
91  StatusCode io_register (IIoComponent* iocomponent,
93  const std::string& fname,
94  const std::string& pfn);
95 
99  virtual
100  StatusCode io_update (IIoComponent* iocomponent,
101  const std::string& old_fname,
102  const std::string& new_fname);
103 
107  virtual
108  StatusCode io_update (IIoComponent* iocomponent,
109  const std::string& work_dir);
110 
111  // VT. new method
114  virtual
115  StatusCode io_update_all (const std::string& work_dir);
116 
120  virtual
121  StatusCode io_retrieve (IIoComponent* iocomponent,
122  std::string& fname);
123 
128  virtual
130 
135  virtual
137 
139  // Private data:
141  private:
142 
145  std::string m_oldabspath; // VT. store absolute path
148 
149  IoComponentEntry():m_oldfname(""),m_oldabspath(""),m_newfname(""), // VT. changes
150  m_iomode(IIoComponentMgr::IoMode::INVALID) {}
151  IoComponentEntry(const std::string& f, const std::string& p, // VT. changes
153  : m_oldfname(f), m_oldabspath(p),m_newfname(""), m_iomode(t){} // VT. changes
155  m_oldabspath(rhs.m_oldabspath), // VT. changes
156  m_newfname(rhs.m_newfname),
157  m_iomode(rhs.m_iomode){}
158  bool operator < (IoComponentEntry const &rhs) const {
159  if (m_oldfname == rhs.m_oldfname) {
160  return (m_iomode < rhs.m_iomode);
161  } else {
162  return (m_oldfname < rhs.m_oldfname);
163  }
164  }
165 
167  os << "old: \"" << c.m_oldfname
168  << "\" absolute path: \"" << c.m_oldabspath
169  << "\" new: \"" << c.m_newfname
170  << "\" m: " << ( (c.m_iomode == IIoComponentMgr::IoMode::READ) ?
171  "R" : "W" );
172  return os;
173  }
174 
175  };
176 
177 
178 
180  IoComponentMgr();
181 
182  mutable MsgStream m_log;
183 
187 
191 
192 
193  // This is the registry
196 
198 
201 
202  bool findComp(IIoComponent*, const std::string&, iodITR& ) const;
204  bool findComp(const std::string&, std::pair<iodITR,iodITR>& ) const;
205 
206  std::string list() const;
207 
208 
209 };
210 
211 
212 #endif //> !GAUDIMP_IOCOMPONENTMGR_H

Generated at Mon Feb 17 2014 14:37:46 for Gaudi Framework, version v25r0 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004