HydraExpress™ C++ 2020 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
A subtype of NamedObjectImp used to wrap an object, as a pointer, in a NamedObject handle. More...
#include <rwsf/core/NamedObject.h>
Public Member Functions | |
PointerNamedObjectImp () | |
PointerNamedObjectImp (T *objImpl, bool needsDeletion=false) | |
virtual | ~PointerNamedObjectImp () |
T * | getValue () const |
virtual void | init () |
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:
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:
true
. 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.
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.
|
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.
T* rwsf::PointerNamedObjectImp< T >::getValue | ( | ) | const |
Returns the underlying, wrapped object as its object pointer.
|
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. |