HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
rwsf::PointerNamedObjectImp< T > Class Template Reference

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

Public Member Functions

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

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 © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.