HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::TypedNamedObjectImp< T > Class Template Reference

A subtype of NamedObjectImp used to wrap an object instance in a NamedObject handle. More...

#include <rwsf/core/NamedObject.h>

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

Public Member Functions

 TypedNamedObjectImp ()
 TypedNamedObjectImp (const T &objImpl)
getValue () const

Detailed Description

template<class T>
class rwsf::TypedNamedObjectImp< T >

TypeNamedObjectImp is a subtype of NamedObjectImp and can be used to wrap an object instance in a NamedObject handle. The object wrapped by this NamedObject body type is passed by value, so performance considerations should be taken into account.

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:

  • Allow the constructor to create a default, templatized object. This is the easiest method, but requires that the object have a functioning default constructor.
  • Create the object first, then wrap it with the TypedNamedObjectImp. This method allows for flexible construction if needed, but results in a copy operation on the object being stored.

In both cases, the stored object is local to the TypedNamedObjectImp instance, so no action is necessary regarding the object's lifetime.

Constructor & Destructor Documentation

◆ TypedNamedObjectImp() [1/2]

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

Creates a TypedNamedObjectImp body with a newly created object of type T. The type T must have a default constructor defined.

◆ TypedNamedObjectImp() [2/2]

template<class T>
rwsf::TypedNamedObjectImp< T >::TypedNamedObjectImp ( const T & objImpl)

Creates a TypedNamedObjectImp body, wrapping the given object objImpl. The objImpl is copied during construction.

Member Function Documentation

◆ getValue()

template<class T>
T rwsf::TypedNamedObjectImp< T >::getValue ( ) const

Returns a copy of the stored object.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.