Main Page Class Hierarchy Compound List Compound Members SoamSmartPtr Class Template Reference
Smart pointer template. More...
Public Methods
T * operator-> () const This operator makes it possible for the developer to access the smart pointer as if it were the actual API object. bool isNull () const test for null. void setNull () sets the internal reference of the smart pointer to null. SoamSmartPtr< T > & operator= (SoamSmartPtr< T > other) Assigns a reference to the object being pointed to by the smart pointer presented. SoamSmartPtr< T > & operator= (T *obj) Assigns a reference to the object being pointed to by the raw pointer presented. bool operator== (const SoamSmartPtr< T > &a) const This operator allows the developer to compare references from two different smart pointers. bool operator!= (const SoamSmartPtr< T > &a) const This operator allows the developer to compare references from two different smart pointers. Detailed Description
template<class T>
Smart pointer template.
class SoamSmartPtr< T >The C++ API attempts to make the memory management of all objects created by the API as seamless as possible for the developer. This means memory management is done automatically when the developer stores any object created by the API in a smart pointer of the appropriate type. The developer can directly access methods and attributes on an object through its corresponding smart pointer. The names of all smart pointer classes will generally take the form
ClassNamePtr
. For example, the smart pointer associated with theConnection
class will have the nameConnectionPtr
.
The usage of various smart pointers is best demonstrated in the C++ samples.NOTE:
1. The developer is still responsible for managing the lifecycle of any objects that are created by the application itself.
2. If any of the methods of this class are called after the main(...) method exits, the client or service process may behave in an undefined manner (for example, hang or terminate abnormally).
Member Function Documentation
T* operator-> ( ) const
This operator makes it possible for the developer to access the smart pointer as if it were the actual API object.
- Returns:
- a reference to the API object.
bool isNull ( ) const
test for null.
Tests if the internal reference of the smart pointer is null.
- Returns:
- true if the internal reference is null and false otherwise.
void setNull ( )
sets the internal reference of the smart pointer to null.
SoamSmartPtr<T>& operator= ( SoamSmartPtr< T > other )
Assigns a reference to the object being pointed to by the smart pointer presented.
The current reference will be cleaned up automatically during the assignment.
SoamSmartPtr<T>& operator= ( T * obj )
Assigns a reference to the object being pointed to by the raw pointer presented.
The current reference will be cleaned up automatically during the assignment.
bool operator== ( const SoamSmartPtr< T > & a ) const
This operator allows the developer to compare references from two different smart pointers.
This test is for equality.
- Returns:
- true if both smart pointers point to the same API object, false otherwise.
bool operator!= ( const SoamSmartPtr< T > & a ) const
This operator allows the developer to compare references from two different smart pointers.
This test is for in-equality.
- Returns:
- true if both smart pointers point to different API object, false otherwise.
Date Modified: 28 Apr 2011
Platform Support: support@platform.com
Platform Information Development: doc@platform.com
Platform Computing. Accelerating Intelligence(TM).
Copyright © 2001-2009 Platform Computing Corporation. All rights reserved.