|
MULTIBODY SIMULATION SOFTWARE - API documentation |
#include <CHsmartpointers.h>
Public Types | |
| typedef T | element_type |
Public Member Functions | |
| ChSmartPtr (T *p=0) | |
| ChSmartPtr (const ChSmartPtr &r) throw () | |
| template<class T_other> | |
| ChSmartPtr (const ChSmartPtr< T_other > &r) throw () | |
| ~ChSmartPtr () | |
| ChSmartPtr & | operator= (const ChSmartPtr &r) |
| T & | operator * () throw () |
| const T & | operator * () const throw () |
| T * | operator-> () throw () |
| const T * | operator-> (void) const throw () |
| bool | IsUnique () const throw () |
| T * | get_ptr () const throw () |
| T * | get () const throw () |
| chrono::ChSmartPtr< T >::ChSmartPtr | ( | T * | p = 0 |
) | [explicit] |
Constructor for initializing with dynamically allocated data. Suggested way of using it: ChSmartPtr<MyClass> pointerA(new MyClass);
| chrono::ChSmartPtr< T >::ChSmartPtr | ( | const ChSmartPtr< T > & | r | ) | throw () |
Copy constructor for the case ChSmartPtr<MyClassA> pointerA(pointerB);
| chrono::ChSmartPtr< T >::ChSmartPtr | ( | const ChSmartPtr< T_other > & | r | ) | throw () |
Copy constructor and converter for the case ChSmartPtr<MyClassA> pointerA(pointerB); when pointerB comes from a class MyClassB which is inherited from MyClassA. Warnings! - no check on MyClassB being really inherited from MyClassB,
| chrono::ChSmartPtr< T >::~ChSmartPtr | ( | ) |
Destructor decrements the reference count and automatically delete only when the last reference is destroyed
| ChSmartPtr& chrono::ChSmartPtr< T >::operator= | ( | const ChSmartPtr< T > & | r | ) |
Assignment form for an already-constructed smart-pointer.
| T& chrono::ChSmartPtr< T >::operator * | ( | ) | throw () |
Dereference the smart pointer to get the object, as in the form *p1.
| T* chrono::ChSmartPtr< T >::operator-> | ( | ) | throw () |
Used for member access to the contained object, e.g. pointer->Print() calls T::Print()
| bool chrono::ChSmartPtr< T >::IsUnique | ( | ) | const throw () |
Tells if this is shared by no one else.
| T* chrono::ChSmartPtr< T >::get_ptr | ( | ) | const throw () |
Returns the raw pointer to pointed instance. Note: If a correct programming style is used, you should never need to use this.
CHRONO::ENGINE