| The Gaudi Framework v32r1 (f65d50dc)

Public 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)
template<class T , typename = std::enable_if_t<std::is_constructible< TypeNameString, decltype( std::declval<const T&>().value() )>::value>>
| TypeNameString (const T &prop)
const std::string & | type () const
const std::string & | name () const
bool | haveType () const

## 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 10 of file TypeNameString.h.

## Constructor & Destructor Documentation

## ◆ TypeNameString() [1/4]

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

Definition at line 15 of file TypeNameString.h.

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

## ◆ TypeNameString() [2/4]

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

Definition at line 16 of file TypeNameString.h.

16 : m_type{tn} {
17 const auto slash_pos = m_type.find_first_of( "/" );
18 m_haveType = slash_pos != std::string::npos;
19 if ( m_haveType ) {
20 m_name = m_type.substr( slash_pos + 1 );
21 m_type = m_type.substr( 0, slash_pos );
22 } else
23 m_name = m_type;
24 }
Gaudi::Utils::TypeNameString::m_haveType
bool m_haveType
Definition: TypeNameString.h:12
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:11
Gaudi::Utils::TypeNameString::m_type
std::string m_type
Definition: TypeNameString.h:11

## ◆ TypeNameString() [3/4]

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

Definition at line 26 of file TypeNameString.h.

26 : TypeNameString( tn ) {
27 if ( !m_haveType ) m_type = deftyp;
28 }
Gaudi::Utils::TypeNameString::m_haveType
bool m_haveType
Definition: TypeNameString.h:12
Gaudi::Utils::TypeNameString::TypeNameString
TypeNameString(const char tn[])
Definition: TypeNameString.h:15
Gaudi::Utils::TypeNameString::m_type
std::string m_type
Definition: TypeNameString.h:11

## ◆ TypeNameString() [4/4]

template<class T , typename = std::enable_if_t<std::is_constructible< TypeNameString, decltype( std::declval<const T&>().value() )>::value>>

Gaudi::Utils::TypeNameString::TypeNameString | ( | const T & | prop | ) |
| inline

Definition at line 34 of file TypeNameString.h.

34 : TypeNameString( prop.value() ) {}
Gaudi::Utils::TypeNameString::TypeNameString
TypeNameString(const char tn[])
Definition: TypeNameString.h:15

## Member Function Documentation

## ◆ haveType()

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

Definition at line 38 of file TypeNameString.h.

38 { return m_haveType; }
Gaudi::Utils::TypeNameString::m_haveType
bool m_haveType
Definition: TypeNameString.h:12

## ◆ name()

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

Definition at line 37 of file TypeNameString.h.

37 { return m_name; }
Gaudi::Utils::TypeNameString::m_name
std::string m_name
Definition: TypeNameString.h:11

## ◆ type()

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

Definition at line 36 of file TypeNameString.h.

36 { return m_type; }
Gaudi::Utils::TypeNameString::m_type
std::string m_type
Definition: TypeNameString.h:11

## Member Data Documentation

## ◆ m_haveType

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

Definition at line 12 of file TypeNameString.h.

## ◆ m_name

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

Definition at line 11 of file TypeNameString.h.

## ◆ m_type

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

Definition at line 11 of file TypeNameString.h.

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

- GaudiKernel/GaudiKernel/TypeNameString.h