Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Omniifr::Creche< T > Class Template Reference

Used to hold IRObject_impl objects while they are being constructed. More...

#include <Creche.h>

Collaboration diagram for Omniifr::Creche< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Creche (T *ptr)
 ~Creche ()
T * get () const
T * operator-> () const
T * release (const char *oidStr=NULL)
 Activates the object and releases it into the 'wild'.

Private Member Functions

 Creche (const Creche &)
 No implementation.

Private Attributes

T * _ptr

Detailed Description

template<class T>
class Omniifr::Creche< T >

Used to hold IRObject_impl objects while they are being constructed.

Automatically calls uncheckedDestroy() if the destructer is called without the contents first being removed. Ensures that they are properly cleaned up if an exception is raised.

Definition at line 35 of file Creche.h.


Constructor & Destructor Documentation

template<class T>
Omniifr::Creche< T >::Creche T *  ptr  )  [inline]
 

Definition at line 38 of file Creche.h.

References Omniifr::Creche< T >::_ptr.

00038 :_ptr(ptr){assert(_ptr);}

template<class T>
Omniifr::Creche< T >::~Creche  )  [inline]
 

Definition at line 39 of file Creche.h.

References Omniifr::Creche< T >::_ptr.

00040   {
00041     if(_ptr)
00042     {
00043       _ptr->uncheckedDestroy();
00044       _ptr->_remove_ref(); // Kill the constructor's reference to this.
00045       _ptr=NULL;
00046     }
00047   }

template<class T>
Omniifr::Creche< T >::Creche const Creche< T > &   )  [private]
 

No implementation.


Member Function Documentation

template<class T>
T* Omniifr::Creche< T >::get  )  const [inline]
 

Definition at line 48 of file Creche.h.

References Omniifr::Creche< T >::_ptr.

Referenced by Omniifr::Container_impl::recreate(), and Omniifr::Repository_impl::reincarnate().

00048 {return _ptr;}

template<class T>
T* Omniifr::Creche< T >::operator->  )  const [inline]
 

Definition at line 49 of file Creche.h.

References Omniifr::Creche< T >::_ptr.

00049 {return _ptr;}

template<class T>
T* Omniifr::Creche< T >::release const char *  oidStr = NULL  )  [inline]
 

Activates the object and releases it into the 'wild'.

If an ObjectID is provided, then the object is activated with that ID, otherwise a new random ID is assigned.

Definition at line 54 of file Creche.h.

References Omniifr::Creche< T >::_ptr.

Referenced by Omniifr::Container_impl::create_alias(), Omniifr::Repository_impl::create_array(), Omniifr::InterfaceDef_impl::create_attribute(), Omniifr::Container_impl::create_constant(), Omniifr::Container_impl::create_enum(), Omniifr::Container_impl::create_exception(), Omniifr::Repository_impl::create_fixed(), Omniifr::Container_impl::create_interface(), Omniifr::Container_impl::create_module(), Omniifr::InterfaceDef_impl::create_operation(), Omniifr::Repository_impl::create_sequence(), Omniifr::Repository_impl::create_string(), Omniifr::Container_impl::create_struct(), Omniifr::Container_impl::create_union(), Omniifr::Repository_impl::create_wstring(), Omniifr::Container_impl::recreate(), Omniifr::Repository_impl::reincarnate(), and Omniifr::InterfaceDef_impl::reincarnate().

00055   {
00056     assert(_ptr);
00057     T* result=_ptr;
00058     if(oidStr)
00059         _ptr->activateObjectWithId(oidStr);
00060     else
00061         _ptr->activateObject();
00062     _ptr=NULL;
00063     return result;
00064   }


Member Data Documentation

template<class T>
T* Omniifr::Creche< T >::_ptr [private]
 

Definition at line 67 of file Creche.h.

Referenced by Omniifr::Creche< T >::Creche(), Omniifr::Creche< T >::get(), Omniifr::Creche< T >::operator->(), Omniifr::Creche< T >::release(), and Omniifr::Creche< T >::~Creche().


The documentation for this class was generated from the following file:
Generated on Fri Mar 4 13:03:58 2005 for OmniIFR by  doxygen 1.4.1