CMS 3D CMS Logo

Public Member Functions | Private Attributes

cond::PayloadRef< DataT > Class Template Reference

#include <PayloadRef.h>

List of all members.

Public Member Functions

void clear ()
bool load (DbSession &dbSess, std::string const &itoken)
const DataT & operator* () const
 PayloadRef ()
 ~PayloadRef ()

Private Attributes

boost::shared_ptr< DataT > m_Data

Detailed Description

template<typename DataT>
class cond::PayloadRef< DataT >

Definition at line 10 of file PayloadRef.h.


Constructor & Destructor Documentation

template<typename DataT>
cond::PayloadRef< DataT >::PayloadRef ( ) [inline]

Definition at line 13 of file PayloadRef.h.

{}
template<typename DataT>
cond::PayloadRef< DataT >::~PayloadRef ( ) [inline]

Definition at line 14 of file PayloadRef.h.

{}

Member Function Documentation

template<typename DataT>
void cond::PayloadRef< DataT >::clear ( void  ) [inline]

Definition at line 21 of file PayloadRef.h.

Referenced by cond::PayloadRef< std::vector< cond::Time_t > >::load().

                 {
      m_Data.reset();
    }
template<typename DataT>
bool cond::PayloadRef< DataT >::load ( DbSession dbSess,
std::string const &  itoken 
) [inline]

Definition at line 26 of file PayloadRef.h.

                                                            {
      clear();
      bool ok = false;
      // is it ok to open a transaction here? or could be at higher level?
      boost::shared_ptr<DataT> tmp = dbSess.getTypedObject<DataT>( itoken );
      if (tmp.get()) {
        m_Data = tmp;
        ok =  true;
      }
      return ok;
    }
template<typename DataT>
const DataT& cond::PayloadRef< DataT >::operator* ( ) const [inline]

Definition at line 17 of file PayloadRef.h.

                                    {
      return *m_Data; 
    }

Member Data Documentation

template<typename DataT>
boost::shared_ptr<DataT> cond::PayloadRef< DataT >::m_Data [private]