Open CASCADE Technology 7.8.0
|
Purpose: This template class is used to define Handle adaptor for allocated dynamically objects of arbitrary type. More...
#include <NCollection_Handle.hxx>
Public Types | |
typedef T | element_type |
Public Types inherited from opencascade::handle< Standard_Transient > | |
typedef Standard_Transient | element_type |
STL-compliant typedef of contained type. | |
Public Member Functions | |
NCollection_Handle () | |
Default constructor; creates null handle. | |
NCollection_Handle (T *theObject) | |
Constructor of handle from pointer on newly allocated object. | |
T * | get () |
Cast handle to contained type. | |
const T * | get () const |
Cast handle to contained type. | |
T * | operator-> () |
Cast handle to contained type. | |
const T * | operator-> () const |
Cast handle to contained type. | |
T & | operator* () |
Cast handle to contained type. | |
const T & | operator* () const |
Cast handle to contained type. | |
Public Member Functions inherited from opencascade::handle< Standard_Transient > | |
handle () | |
Empty constructor. | |
handle (const Standard_Transient *thePtr) | |
Constructor from pointer to new object. | |
handle (const handle &theHandle) | |
Copy constructor. | |
handle (handle &&theHandle) Standard_Noexcept | |
Move constructor. | |
~handle () | |
Destructor. | |
void | Nullify () |
Nullify the handle. | |
bool | IsNull () const |
Check for being null. | |
void | reset (Standard_Transient *thePtr) |
Reset by new pointer. | |
handle & | operator= (const handle &theHandle) |
Assignment operator. | |
handle & | operator= (const Standard_Transient *thePtr) |
Assignment to pointer. | |
handle & | operator= (handle &&theHandle) Standard_Noexcept |
Move operator. | |
Standard_Transient * | get () const |
STL-like cast to pointer to referred object (note non-const). | |
Standard_Transient * | operator-> () const |
Member access operator (note non-const) | |
Standard_Transient & | operator* () const |
Dereferencing operator (note non-const) | |
bool | operator== (const handle< T2 > &theHandle) const |
Check for equality. | |
bool | operator== (const T2 *thePtr) const |
Check for equality. | |
bool | operator!= (const handle< T2 > &theHandle) const |
Check for inequality. | |
bool | operator!= (const T2 *thePtr) const |
Check for inequality. | |
bool | operator< (const handle< T2 > &theHandle) const |
Compare operator for possible use in std::map<> etc. | |
operator Standard_Transient *handle::* () const | |
Conversion to bool-compatible type for use in conditional expressions. | |
operator const handle< T2 > & () const | |
Upcast to const reference to base type. NB: this implementation will cause ambiguity errors on calls to overloaded functions accepting handles to different types, since compatibility is checked in the cast code rather than ensured by SFINAE (possible with C++11) | |
operator handle< T2 > & () | |
Upcast to non-const reference to base type. NB: this cast can be dangerous, but required for legacy code; see #26377. | |
Static Public Member Functions | |
static NCollection_Handle< T > | DownCast (const opencascade::handle< Standard_Transient > &theOther) |
Downcast arbitrary Handle to the argument type if contained object is Handle for this type; returns null otherwise. | |
Static Public Member Functions inherited from opencascade::handle< Standard_Transient > | |
static opencascade::std::enable_if< is_base_but_not_same< T2, Standard_Transient >::value, handle >::type | DownCast (const handle< T2 > &theObject) |
Down casting operator from handle to base type. | |
static opencascade::std::enable_if< is_base_but_not_same< T2, Standard_Transient >::value, handle >::type | DownCast (const T2 *thePtr) |
Down casting operator from pointer to base type. | |
static handle | DownCast (const handle< T2 > &theObject, typename opencascade::std::enable_if<!is_base_but_not_same< T2, Standard_Transient >::value, void * >::type=0) |
For compatibility, define down casting operator from non-base type, as deprecated. | |
static handle | DownCast (const T2 *thePtr, typename opencascade::std::enable_if<!is_base_but_not_same< T2, Standard_Transient >::value, void * >::type=0) |
For compatibility, define down casting operator from non-base type, as deprecated. | |
Purpose: This template class is used to define Handle adaptor for allocated dynamically objects of arbitrary type.
The advantage is that this handle will automatically destroy the object when last referred Handle is destroyed (i.e. it is a typical smart pointer), and that it can be handled as Handle(Standard_Transient) in OCCT components.
typedef T NCollection_Handle< T >::element_type |
|
inline |
Default constructor; creates null handle.
|
inline |
Constructor of handle from pointer on newly allocated object.
|
inlinestatic |
Downcast arbitrary Handle to the argument type if contained object is Handle for this type; returns null otherwise.
|
inline |
Cast handle to contained type.
|
inline |
Cast handle to contained type.
|
inline |
Cast handle to contained type.
|
inline |
Cast handle to contained type.
|
inline |
Cast handle to contained type.
|
inline |
Cast handle to contained type.