pair_base_member< Base, Member > Class Template Reference
[Application Framework]

Search Toolkit Book for pair_base_member

#include <ncbimisc.hpp>

Inheritance diagram for pair_base_member< Base, Member >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class Base, class Member>
class pair_base_member< Base, Member >

Template used for empty base class optimization.

See details in the August '97 "C++ Issue" of Dr. Dobb's Journal Also available from http://www.cantrip.org/emptyopt.html We store usually empty template argument class together with data member. This template is much like STL's pair<>, but the access to members is done though methods first() and second() returning references to corresponding members. First template argument is represented as private base class, while second template argument is represented as private member. In addition to constructor taking two arguments, we add constructor for initialization of only data member (second). This is useful since usually first type is empty and doesn't require non-trivial constructor. We do not define any comparison functions as this template is intented to be used internally within another templates, which themselves should provide any additional functionality.

Definition at line 211 of file ncbimisc.hpp.

Public Types

typedef Base base_type
typedef Base first_type
typedef Member member_type
typedef Member second_type

Public Member Functions

 pair_base_member (void)
 pair_base_member (const member_type &member_value)
 pair_base_member (const first_type &first_value, const second_type &second_value)
const first_typefirst () const
first_typefirst ()
const second_typesecond () const
second_typesecond ()
void Swap (pair_base_member< first_type, second_type > &p)

Private Attributes

member_type m_Member


Member Typedef Documentation

template<class Base, class Member>
typedef Base pair_base_member< Base, Member >::base_type
 

Definition at line 214 of file ncbimisc.hpp.

template<class Base, class Member>
typedef Base pair_base_member< Base, Member >::first_type
 

Definition at line 215 of file ncbimisc.hpp.

template<class Base, class Member>
typedef Member pair_base_member< Base, Member >::member_type
 

Definition at line 216 of file ncbimisc.hpp.

template<class Base, class Member>
typedef Member pair_base_member< Base, Member >::second_type
 

Definition at line 217 of file ncbimisc.hpp.


Constructor & Destructor Documentation

template<class Base, class Member>
pair_base_member< Base, Member >::pair_base_member void   )  [inline]
 

Definition at line 219 of file ncbimisc.hpp.

template<class Base, class Member>
pair_base_member< Base, Member >::pair_base_member const member_type member_value  )  [inline, explicit]
 

Definition at line 224 of file ncbimisc.hpp.

template<class Base, class Member>
pair_base_member< Base, Member >::pair_base_member const first_type first_value,
const second_type second_value
[inline, explicit]
 

Definition at line 229 of file ncbimisc.hpp.


Member Function Documentation

template<class Base, class Member>
first_type& pair_base_member< Base, Member >::first  )  [inline]
 

Definition at line 239 of file ncbimisc.hpp.

template<class Base, class Member>
const first_type& pair_base_member< Base, Member >::first  )  const [inline]
 

Definition at line 235 of file ncbimisc.hpp.

Referenced by CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::AtomicReleaseTo(), CRef< CQueueItem >::AtomicReleaseTo(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::AtomicResetFrom(), CRef< CQueueItem >::AtomicResetFrom(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::CConstRef(), CRef< CQueueItem >::CRef(), CGuard< SSystemMutex >::GetLock(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::GetLocker(), CRef< CQueueItem >::GetLocker(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::Release(), CRef< CQueueItem >::Release(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::ReleaseOrNull(), CRef< CQueueItem >::ReleaseOrNull(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::Reset(), CRef< CQueueItem >::Reset(), AutoArray< CS_INT >::reset(), AutoPtr< CNcbiOstrstream >::reset(), pair_base_member< convert_to_string_type, value_type >::Swap(), CBlobIdFor< Value, Converter >::ToString(), and CStaticArraySearchBase< PKeyValueSelf< KeyType >, KeyCompare >::value_comp().

template<class Base, class Member>
second_type& pair_base_member< Base, Member >::second  )  [inline]
 

Definition at line 248 of file ncbimisc.hpp.

template<class Base, class Member>
const second_type& pair_base_member< Base, Member >::second  )  const [inline]
 

Definition at line 244 of file ncbimisc.hpp.

Referenced by CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::AtomicResetFrom(), CRef< CQueueItem >::AtomicResetFrom(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::AtomicSwap(), CRef< CQueueItem >::AtomicSwap(), CStaticArraySearchBase< PKeyValueSelf< KeyType >, KeyCompare >::begin(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::CConstRef(), CRef< CQueueItem >::CRef(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::Empty(), CRef< CQueueItem >::Empty(), CRef< CQueueItem >::GetNCPointerOrNull(), CRef< CQueueItem >::GetNonNullNCPointer(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::GetNonNullPointer(), CRef< CQueueItem >::GetNonNullPointer(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::GetPointerOrNull(), CRef< CQueueItem >::GetPointerOrNull(), CGuard< SSystemMutex >::GetResource(), CGuard< SSystemMutex >::GetUnlock(), CBlobIdFor< Value, Converter >::GetValue(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::IsNull(), CRef< CQueueItem >::IsNull(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::NotEmpty(), CRef< CQueueItem >::NotEmpty(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::NotNull(), CRef< CQueueItem >::NotNull(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::operator!(), CRef< CQueueItem >::operator!(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::operator=(), CRef< CQueueItem >::operator=(), AutoArray< CS_INT >::operator=(), AutoPtr< CNcbiOstrstream >::operator=(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::Release(), CRef< CQueueItem >::Release(), AutoArray< CS_INT >::release(), AutoPtr< CNcbiOstrstream >::release(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::ReleaseOrNull(), CRef< CQueueItem >::ReleaseOrNull(), CConstRef< IAppJobError, CInterfaceObjectLocker< IAppJobError > >::Reset(), CRef< CQueueItem >::Reset(), AutoArray< CS_INT >::reset(), AutoPtr< CNcbiOstrstream >::reset(), pair_base_member< convert_to_string_type, value_type >::Swap(), and CBlobIdFor< Value, Converter >::ToString().

template<class Base, class Member>
void pair_base_member< Base, Member >::Swap pair_base_member< first_type, second_type > &  p  )  [inline]
 

Definition at line 253 of file ncbimisc.hpp.


Member Data Documentation

template<class Base, class Member>
member_type pair_base_member< Base, Member >::m_Member [private]
 

Definition at line 264 of file ncbimisc.hpp.

Referenced by pair_base_member< convert_to_string_type, value_type >::second().


The documentation for this class was generated from the following file:
Generated on Mon Dec 7 15:45:26 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:29 2009 by modify_doxy.py rev. 173732