rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::PointerNamedObjectImp< T > Class Template Reference
[Core Generic Object]

A subtype of NamedObjectImp used to wrap an object, as a pointer, in a NamedObject handle. More...

#include <rwsf/core/NamedObject.h>

Inheritance diagram for rwsf::PointerNamedObjectImp< T >:
rwsf::NamedObjectImp

List of all members.

Public Member Functions

 PointerNamedObjectImp ()
 PointerNamedObjectImp (T *objImpl, bool needsDeletion=false)
virtual ~PointerNamedObjectImp ()
virtual void init ()
T * getValue () const

Detailed Description

template<class T>
class rwsf::PointerNamedObjectImp< T >

The PointerNamedObjectImp is a subtype of NamedObjectImp and can be used to wrap an object, as a pointer, in a NamedObject handle. The object wrapped by this NamedObject body type must have an init() function declared and defined:

   void init(const rwsf::Config& config);

Since this is a templatized function, the type of object wrapped serves as the template parameter to this class and its functions. There are two ways to create a PointerNamedObjectImp:


Constructor & Destructor Documentation

template<class T >
rwsf::PointerNamedObjectImp< T >::PointerNamedObjectImp (  ) 

Constructs a new PointerNamedObjectImp body with a pointer to a new object of templatized type T. This requires that type T have a default constructor.

template<class T >
rwsf::PointerNamedObjectImp< T >::PointerNamedObjectImp ( T *  objImpl,
bool  needsDeletion = false 
)

Constructs a new PointerNamedObjectImp body, wrapped around the existing object objImpl. To delete objImpl when this body is deleted, set needsDeletion to true. The default is false, allowing control over the lifetime of the objImpl.

template<class T >
virtual rwsf::PointerNamedObjectImp< T >::~PointerNamedObjectImp (  )  [virtual]

Destructor called when the last NamedObject handle pointing to this body goes out of scope. If needsDeletion was set to true when this object was constructed, or the default constructor was used to create this body, the wrapped object is also deleted.


Member Function Documentation

template<class T >
T* rwsf::PointerNamedObjectImp< T >::getValue (  )  const

Returns the underlying, wrapped object as its object pointer.

template<class T >
virtual void rwsf::PointerNamedObjectImp< T >::init (  )  [virtual]

Calls void init(const rwsf::Config&) on the stored object. This function must exist, or compiler or linker errors will occur when generating the template code for the module that uses this class.

Implements rwsf::NamedObjectImp.


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.