CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
cond::service::GetTokenFromPointer< T > Struct Template Reference

#include <PoolDBOutputService.h>

Inheritance diagram for cond::service::GetTokenFromPointer< T >:
cond::service::GetToken

Public Member Functions

 GetTokenFromPointer (T *p)
 
virtual std::string operator() (cond::DbSession &pooldb) const
 

Static Public Member Functions

static std::string classNameForPointer (T *pointer)
 

Public Attributes

Tm_p
 

Detailed Description

template<typename T>
struct cond::service::GetTokenFromPointer< T >

Definition at line 69 of file PoolDBOutputService.h.

Constructor & Destructor Documentation

template<typename T >
cond::service::GetTokenFromPointer< T >::GetTokenFromPointer ( T p)
inlineexplicit

Member Function Documentation

template<typename T >
static std::string cond::service::GetTokenFromPointer< T >::classNameForPointer ( T pointer)
inlinestatic

Definition at line 72 of file PoolDBOutputService.h.

References cond::classNameForTypeId().

Referenced by cond::service::GetTokenFromPointer< T >::operator()().

72  {
73  if(!pointer) return classNameForTypeId( typeid(T) );
74  return classNameForTypeId( typeid(*pointer) );
75  }
std::string classNameForTypeId(const std::type_info &typeInfo)
long double T
template<typename T >
virtual std::string cond::service::GetTokenFromPointer< T >::operator() ( cond::DbSession pooldb) const
inlinevirtual

Implements cond::service::GetToken.

Definition at line 80 of file PoolDBOutputService.h.

References cond::className(), cond::service::GetTokenFromPointer< T >::classNameForPointer(), cond::service::GetTokenFromPointer< T >::m_p, and cond::DbSession::storeObject().

80  {
81  std::string className = classNameForPointer( m_p );
82  boost::shared_ptr<T> sptr( m_p );
83  return pooldb.storeObject(m_p,className);
84  }
static std::string classNameForPointer(T *pointer)
std::string storeObject(const T *object, const std::string &containerName)
Definition: DbSession.h:131
char const * className(const std::type_info &t)
Definition: ClassID.cc:8

Member Data Documentation

template<typename T >
T* cond::service::GetTokenFromPointer< T >::m_p