Gaudi Framework, version v23r9

Home   Generated: Thu Jul 18 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TypeNameString.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_TYPENAMESTRING_H
2 #define GAUDIKERNEL_TYPENAMESTRING_H
3 #include <string>
4 
5 namespace Gaudi {
6  namespace Utils {
8  class TypeNameString {
10  bool m_haveType;
11  void init(const std::string& tn, const std::string& deftyp) {
12  const std::string::size_type slash_pos = tn.find_first_of("/");
13  m_haveType = slash_pos != std::string::npos;
14  m_name = (m_haveType) ? tn.substr( slash_pos + 1) : tn;
15  m_type = (m_haveType) ? tn.substr( 0, slash_pos ) : deftyp;
16  }
17  public:
18  TypeNameString(const char tn[]): m_haveType(false) { init(tn, tn); }
19  TypeNameString(const std::string& tn): m_haveType(false) { init(tn, tn); }
20  TypeNameString(const std::string& tn, const std::string& deftyp) { init(tn, deftyp); m_haveType = true; }
21  const std::string& type() const { return m_type; }
22  const std::string& name() const { return m_name; }
23  bool haveType() const { return m_haveType; }
24  };
25 
28  return s << tn.type() << '/' << tn.name();
29  }
30  }
31 }
32 
33 
34 #endif // GAUDIKERNEL_TYPENAMESTRING_H

Generated at Thu Jul 18 2013 12:18:03 for Gaudi Framework, version v23r9 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004