FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoPtr< T > Class Template Reference

#include <Ptr.h>

List of all members.


Detailed Description

template<class T>
class FdoPtr< T >

FdoPtr is smart pointer to FDO objects. It automatically handles the memory management for these objects. In particular it handles the adding and releasing of references on the objects, and their deletion when the last reference is released.

When the FdoPtr goes out of scope, the FDO object that it references is released.

Definition at line 61 of file Ptr.h.


Public Types

typedef T _PtrClass

Public Member Functions

void Attach (T *p2) throw ()
 Attaches the given object to this FdoPtr. It does not add a reference on the object. However, the object previously referenced by this FdoPtr is released.
bool CopyTo (T **ppT) throw ()
 Copies this FdoPtr's object to a double pointer. A reference is added to the object.
T * Detach () throw ()
 Detaches this FdoPtr's object from this FdoPtr. It does not release the object.
 FdoPtr (const FdoPtr< T > &lp) throw ()
 FdoPtr copy constructor. Wraps a new FdoPtr around the object referenced by lp.
 FdoPtr (T *lp) throw ()
 Constructs a FdoPtr around the given object.
 FdoPtr (FdoInt32 nNull) throw ( FdoException *)
 Constructs a FdoPtr that initially points to NULL.
 FdoPtr () throw ()
 Constructs a FdoPtr that initially points to NULL.
T ** operator & () throw (FdoException *)
 FdoPtr object extractor.
T & operator * () const throw (FdoException *)
 FdoPtr object extractor.
 operator T * () const throw ()
 FdoPtr object extractor.
bool operator! () const throw ()
 Is Null operator.
_NoAddRefReleaseOnFdoPtr<
T > * 
operator-> () const throw (FdoException *)
bool operator< (T *pT) const throw ()
 Less than operator.
template<class U>
T * operator= (const FdoPtr< U > &lp) throw ()
 Assignment operator for unmatched smart-pointer types. Assign the given FdoPtr's object to this FdoPtr.
T * operator= (const FdoPtr< T > &lp) throw ()
 Assignment operator for matching smart-pointer types. Assign the given FdoPtr's object to this FdoPtr.
T * operator= (T *lp) throw ()
 Assignment operator. Wraps the given object in this FdoPtr.
bool operator== (T *pT) const throw ()
 Equals operator.
void Release () throw ()
 DOXYGEN-IGNORE Release the object and set to NULL
 ~FdoPtr () throw ()
 FdoPtr destructor. If this FdoPtr points to an object then the object is released.

Public Attributes

T * p

Member Typedef Documentation

template<class T>
typedef T FdoPtr< T >::_PtrClass
 

Definition at line 64 of file Ptr.h.


Constructor & Destructor Documentation

template<class T>
FdoPtr< T >::FdoPtr  )  throw () [inline]
 

Constructs a FdoPtr that initially points to NULL.

Returns:
Returns a FdoPtr

Definition at line 72 of file Ptr.h.

template<class T>
FdoPtr< T >::FdoPtr FdoInt32  nNull  )  throw ( FdoException *) [inline]
 

Constructs a FdoPtr that initially points to NULL.

Parameters:
nNull Input always 0
Returns:
Returns a FdoPtr

Definition at line 89 of file Ptr.h.

template<class T>
FdoPtr< T >::FdoPtr T *  lp  )  throw () [inline]
 

Constructs a FdoPtr around the given object.

Parameters:
lp Input the object to wrap.
Returns:
Returns a FdoPtr
Note:
This constructor just attaches the object to this FdoPtr. It does not add a reference on the object.

Definition at line 112 of file Ptr.h.

template<class T>
FdoPtr< T >::FdoPtr const FdoPtr< T > &  lp  )  throw () [inline]
 

FdoPtr copy constructor. Wraps a new FdoPtr around the object referenced by lp.

Parameters:
lp Input the FdoPtr to copy from.
Returns:
Returns a FdoPtr
Note:
This operator adds a reference on the object.

Definition at line 129 of file Ptr.h.

template<class T>
FdoPtr< T >::~FdoPtr  )  throw () [inline]
 

FdoPtr destructor. If this FdoPtr points to an object then the object is released.

Definition at line 140 of file Ptr.h.


Member Function Documentation

template<class T>
void FdoPtr< T >::Attach T *  p2  )  throw () [inline]
 

Attaches the given object to this FdoPtr. It does not add a reference on the object. However, the object previously referenced by this FdoPtr is released.

Parameters:
p2 Input the object to attach.

Definition at line 324 of file Ptr.h.

template<class T>
bool FdoPtr< T >::CopyTo T **  ppT  )  throw () [inline]
 

Copies this FdoPtr's object to a double pointer. A reference is added to the object.

Parameters:
ppT Input the double pointer.
Returns:
Returns true if the object as copied, false if it could not be copied (double pointer is null).

Definition at line 356 of file Ptr.h.

template<class T>
T* FdoPtr< T >::Detach  )  throw () [inline]
 

Detaches this FdoPtr's object from this FdoPtr. It does not release the object.

Returns:
Returns the object that was detached.

Definition at line 338 of file Ptr.h.

template<class T>
T** FdoPtr< T >::operator &  )  throw (FdoException *) [inline]
 

FdoPtr object extractor.

Returns:
Returns a double pointer to the object referenced by this FdoPtr.

Definition at line 185 of file Ptr.h.

template<class T>
T& FdoPtr< T >::operator *  )  const throw (FdoException *) [inline]
 

FdoPtr object extractor.

Returns:
Returns the object referenced by this FdoPtr.

Definition at line 166 of file Ptr.h.

template<class T>
FdoPtr< T >::operator T *  )  const throw () [inline]
 

FdoPtr object extractor.

Returns:
Returns a pointer to the object referenced by this FdoPtr.

Definition at line 152 of file Ptr.h.

template<class T>
bool FdoPtr< T >::operator!  )  const throw () [inline]
 

Is Null operator.

Returns:
Returns true if this FdoPtr points to NULL.

Definition at line 210 of file Ptr.h.

template<class T>
_NoAddRefReleaseOnFdoPtr<T>* FdoPtr< T >::operator->  )  const throw (FdoException *) [inline]
 

Definition at line 194 of file Ptr.h.

template<class T>
bool FdoPtr< T >::operator< T *  pT  )  const throw () [inline]
 

Less than operator.

Parameters:
pT Input the object to compare
Returns:
Returns true if this FdoPtr points to an object whose address is less than the address of the given object.

Definition at line 225 of file Ptr.h.

template<class T>
template<class U>
T* FdoPtr< T >::operator= const FdoPtr< U > &  lp  )  throw () [inline]
 

Assignment operator for unmatched smart-pointer types. Assign the given FdoPtr's object to this FdoPtr.

Parameters:
lp Input the FdoPtr whose object is assigned to this FdoPtr.
Returns:
Returns the object.
Note:
This operator adds a reference on the object and releases the object previously referenced by this FdoPtr.

Definition at line 297 of file Ptr.h.

template<class T>
T* FdoPtr< T >::operator= const FdoPtr< T > &  lp  )  throw () [inline]
 

Assignment operator for matching smart-pointer types. Assign the given FdoPtr's object to this FdoPtr.

Parameters:
lp Input the FdoPtr whose object is assigned to this FdoPtr.
Returns:
Returns the object.
Note:
This operator adds a reference on the object and releases the object previously referenced by this FdoPtr.

Definition at line 277 of file Ptr.h.

template<class T>
T* FdoPtr< T >::operator= T *  lp  )  throw () [inline]
 

Assignment operator. Wraps the given object in this FdoPtr.

Parameters:
lp Input the object to assign to this FdoPtr.
Returns:
Returns lp
Note:
This operator just attaches the object to this FdoPtr. It does not add a reference on the object.

Reimplemented in FdoStringsP, FdoVectorP, and FdoProviderNameTokensP.

Definition at line 257 of file Ptr.h.

template<class T>
bool FdoPtr< T >::operator== T *  pT  )  const throw () [inline]
 

Equals operator.

Parameters:
pT Input the object to compare
Returns:
Returns true if this FdoPtr points to the given object.

Definition at line 239 of file Ptr.h.

template<class T>
void FdoPtr< T >::Release  )  throw () [inline]
 

DOXYGEN-IGNORE Release the object and set to NULL

Definition at line 305 of file Ptr.h.


Member Data Documentation

template<class T>
T* FdoPtr< T >::p
 

Definition at line 366 of file Ptr.h.

Referenced by FdoNamedCollection< ElementMap, FdoException >::CheckDuplicate(), FdoIdentifierCollection::CheckDuplicate(), and FdoXmlElementMapping::GetAliasNames().


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.