#include <cel_autoptr.h>
List of all members.
Detailed Description
template<class T>
class Celartem::AutoPtr< T >
This class controls the lifetime of classes that are derived from Referable class.
Although AutoPtr itself is completely thread-safe, you should synchronize the operations if an instance is used between several threads.
- See also:
- Referable
Constructor & Destructor Documentation
- Parameters:
-
| inPtr | a pointer that specifies Referable derivative class instance. |
template<class T>
template<typename U >
- Parameters:
-
| inPtr | a pointer that specifies Referable derivative class instance. |
- Parameters:
-
| inPtr | Reference to an AutoPtr instance that specifies a Referable derivative class instance. |
template<class T>
template<class U >
- Parameters:
-
| inPtr | Reference to an AutoPtr instance that specifies a Referable derivative class instance. |
Member Function Documentation
This method gives up the ownership of its holding instance; The pointer that has been held is not released by this AutoPtr instance, and you should manually call Referable::releaseRef method of that instance. This method is for advanced purpose only.
- Returns:
- Pointer to the instance.
This method returns the raw pointer; although AutoPtr class also supports implicit cast to raw pointer, it sometimes doesn't work and you may happen to use this function instead.
- Returns:
- the pointer to the Referable instance.
Referenced by Celartem::DjVu::MemoryData::create(), Celartem::DjVu::MemoryData::duplicate(), Celartem::DjVu::PageInfo::encodeINFOChunk(), Celartem::RegularExpression::findNext(), Celartem::RegularExpression::getPtr(), Celartem::RegularExpression::getString(), Celartem::AutoPtr< Storage >::isValid(), Celartem::DjVu::DataLocker::lock(), Celartem::DjVu::DataLocker::release(), and Celartem::AutoPtr< Storage >::~AutoPtr().
This method is to check whether the reference count is 1 or not.
If the reference count is equal to 1, this AutoPtr is the last reference which is keeping the instance in memory and if this AutoPtr releases the reference, the instance will be disposed. In other words, this is the only one reference to the instance and it is not shared with other AutoPtr instances.
- Returns:
true if this is the last reference, otherwise false.
template<class T>
template<typename U >
This function realizes implicit cast to static_cast-able pointer types.
template<class T>
template<typename U >
This function realizes implicit cast to static_cast-able pointer types.
This function realizes implicit cast to static_cast-able pointer types.
This method is to fake the raw pointer.
template<class T>
template<class U >
- Parameters:
-
| inPtr | Reference to an AutoPtr instance that specifies a Referable derivative class instance. |
template<class T>
template<typename U >
- Parameters:
-
| inPtr | Pointer to a Referable derivative class instance. |
- Parameters:
-
| inPtr | Reference to an AutoPtr instance that specifies a Referable derivative class instance. |
This method releases the current instance. Usually, AutoPtr can automatically release the instance when it is removed.
This function does const_cast<> on this instance.
This should not be used frequently...
- Returns:
- De-const-ed pointer to this instance.
The documentation for this class was generated from the following file: