| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes | List of all members
Gaudi::Utils::TypeNameString Class Reference

Helper class to parse a string of format "type/name". More...

`#include <GaudiKernel/TypeNameString.h>`

Collaboration diagram for Gaudi::Utils::TypeNameString:
[legend]

## Public Member Functions
| TypeNameString (const char tn[])
| TypeNameString (const std::string &tn)
| TypeNameString (const std::string &tn, const std::string &deftyp)
const std::string & | type () const
const std::string & | name () const
bool | haveType () const

## Private Member Functions
void | init (const std::string &tn, const std::string &deftyp)

## Private Attributes
std::string | m_type
std::string | m_name
bool | m_haveType

## Detailed Description

Helper class to parse a string of format "type/name".

Definition at line 9 of file TypeNameString.h.

## Constructor & Destructor Documentation

Gaudi::Utils::TypeNameString::TypeNameString | ( | const char | tn[] | ) |
| inline

Definition at line 19 of file TypeNameString.h.

19 : TypeNameString( std::string{tn} ) { }
std::string
STL class.
Gaudi::Utils::TypeNameString::TypeNameString
TypeNameString(const char tn[])
Definition: TypeNameString.h:19

Gaudi::Utils::TypeNameString::TypeNameString | ( | const std::string & | tn | ) |
| inline

Definition at line 20 of file TypeNameString.h.

20 { init(tn, tn); }
Gaudi::Utils::TypeNameString::init
void init(const std::string &tn, const std::string &deftyp)
Definition: TypeNameString.h:12

Gaudi::Utils::TypeNameString::TypeNameString | ( | const std::string & | tn,
|  | const std::string & | deftyp
| ) |  |
| inline

Definition at line 21 of file TypeNameString.h.

21 { init(tn, deftyp); m_haveType = true; }
Gaudi::Utils::TypeNameString::m_haveType
bool m_haveType
Definition: TypeNameString.h:11
Gaudi::Utils::TypeNameString::init
void init(const std::string &tn, const std::string &deftyp)
Definition: TypeNameString.h:12

## Member Function Documentation

bool Gaudi::Utils::TypeNameString::haveType | ( |  | ) | const
| inline

Definition at line 24 of file TypeNameString.h.

24 { return m_haveType; }
Gaudi::Utils::TypeNameString::m_haveType
bool m_haveType
Definition: TypeNameString.h:11

void Gaudi::Utils::TypeNameString::init | ( | const std::string & | tn,
|  | const std::string & | deftyp
| ) |  |
| inline private

Definition at line 12 of file TypeNameString.h.

12 {
13 const std::string::size_type slash_pos = tn.find_first_of("/");
14 m_haveType = slash_pos != std::string::npos;
15 m_name = (m_haveType) ? tn.substr( slash_pos + 1) : tn;
16 m_type = (m_haveType) ? tn.substr( 0, slash_pos ) : deftyp;
17 }
Gaudi::Utils::TypeNameString::m_haveType
bool m_haveType
Definition: TypeNameString.h:11
std::string::find_first_of
T find_first_of(T...args)
std::string::substr
T substr(T...args)
Gaudi::Utils::TypeNameString::m_name
std::string m_name
Definition: TypeNameString.h:10
Gaudi::Utils::TypeNameString::m_type
std::string m_type
Definition: TypeNameString.h:10

const std::string& Gaudi::Utils::TypeNameString::name | ( |  | ) | const
| inline

Definition at line 23 of file TypeNameString.h.

23 { return m_name; }
Gaudi::Utils::TypeNameString::m_name
std::string m_name
Definition: TypeNameString.h:10

const std::string& Gaudi::Utils::TypeNameString::type | ( |  | ) | const
| inline

Definition at line 22 of file TypeNameString.h.

22 { return m_type; }
Gaudi::Utils::TypeNameString::m_type
std::string m_type
Definition: TypeNameString.h:10

## Member Data Documentation

bool Gaudi::Utils::TypeNameString::m_haveType
| private

Definition at line 11 of file TypeNameString.h.

std::string Gaudi::Utils::TypeNameString::m_name
| private

Definition at line 10 of file TypeNameString.h.

std::string Gaudi::Utils::TypeNameString::m_type
| private

Definition at line 10 of file TypeNameString.h.

The documentation for this class was generated from the following file:

- GaudiKernel/GaudiKernel/TypeNameString.h