Gaudi Framework, version v23r5
Home
Generated: Wed Nov 28 2012
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiKernel
GaudiKernel
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
{
9
std::string
m_type
,
m_name
;
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
27
inline
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
TypeNameString
& tn) {
28
return
s << tn.
type
() <<
'/'
<< tn.
name
();
29
}
30
}
31
}
32
33
34
#endif // GAUDIKERNEL_TYPENAMESTRING_H
Generated at Wed Nov 28 2012 12:17:15 for Gaudi Framework, version v23r5 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004