Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Protected Types | Static Protected Member Functions

bsls::NameOf< TYPE > Class Template Reference

#include <bsls_nameof.h>

Inheritance diagram for bsls::NameOf< TYPE >:
bsls::NameOf_Base

List of all members.

Public Member Functions

 NameOf ()
 operator const char * () const
const char * name () const

Protected Types

enum  { k_USELESS_PREAMBLE_LEN = 26 }

Static Protected Member Functions

static const char * initBuffer (char *buffer, const char *functionName)

Detailed Description

template<class TYPE>
class bsls::NameOf< TYPE >

This class provides a means to display the type name of its template parameter TYPE. An instance of this class can be implicitly (or explicitly via the name accessor) cast to a const char * which will point to a buffer containing the description of the type. Note that all instances of a given type will refer to the same character buffer containing the name.

See Component bsls_nameof


Member Enumeration Documentation

anonymous enum [protected, inherited]
Enumerator:
k_USELESS_PREAMBLE_LEN 

Constructor & Destructor Documentation

template<class TYPE >
bsls::NameOf< TYPE >::NameOf (  ) 

Initialize the base class of this object to the name of TYPE.

References BSLS_ASSERT_SAFE, bsls::BslOnceGuard::enter(), bsls::NameOf_Base::initBuffer(), and bsls::NameOf_Base::k_USELESS_PREAMBLE_LEN.


Member Function Documentation

template<class TYPE >
bsls::NameOf< TYPE >::operator const char * (  )  const [inline]

Return a pointer to the a string containing the name of TYPE.

template<class TYPE >
const char * bsls::NameOf< TYPE >::name (  )  const [inline]

Return a pointer to the a string containing the name of TYPE, this serves as a convenient way to explicitly cast the return value to a const char *.

static const char* bsls::NameOf_Base::initBuffer ( char *  buffer,
const char *  functionName 
) [static, protected, inherited]

Initialize the specified buffer with the type name contained in the specified functionName, where functionName is the function name of the NameOf constructor. Return either a pointer to buffer, or if buffer couldn't be properly initialized, functionName.

Referenced by bsls::NameOf< TYPE >::NameOf().


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