Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataStoreItem.h
Go to the documentation of this file.
1 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/DataStoreItem.h,v 1.2 2000/12/13 12:57:12 mato Exp $
2 #ifndef GAUDIKERNEL_DATASTOREITEM_H
3 #define GAUDIKERNEL_DATASTOREITEM_H
4 
5 // STL include files
6 #include <string>
7 
19 protected:
23  int m_depth;
24 public:
26  DataStoreItem (const std::string& path, int depth = 1)
27  : m_path(path), m_depth(depth) {
28  analyse();
29  }
32  : m_path(item.m_path), m_depth(item.m_depth) {
33  analyse();
34  }
36  virtual ~DataStoreItem() {
37  }
39  bool operator==(const DataStoreItem& cmp) const {
40  return m_path == cmp.path() && m_depth == cmp.depth();
41  }
43  bool operator!=(const DataStoreItem& cmp) const {
44  return ! ( m_path == cmp.path() && m_depth == cmp.depth() );
45  }
48  m_path = cmp.path();
49  m_depth = cmp.depth();
50  analyse();
51  return *this;
52  }
54  void analyse() {
55  int len = m_path.length()-1;
56  if ( m_path[len] == '*' ) {
57  m_depth = 99999999;
58  (m_path[len-1] == '/') ? m_path.erase(len-1, 2) : m_path.erase(len, 1);
59  }
60  else if ( m_path[len] == '+' ) {
61  (m_path[len-1] == '/') ? m_path.erase(len-1, 2) : m_path.erase(len, 1);
62  m_depth = 2;
63  }
64  }
66  const std::string& path() const {
67  return m_path;
68  }
70  int depth() const {
71  return m_depth;
72  }
73 };
74 #endif // GAUDIKERNEL_DATASTOREITEM_H

Generated at Wed Dec 4 2013 14:33:08 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004