This class wraps an unmanaged object (or reference) which needs to be released after usage.
More...
|
| | ScopedObjectCompileTimeT ()=default |
| | Default constructor creating an object with invalid object.
|
| | ScopedObjectCompileTimeT (ScopedObjectCompileTimeT< T, TReleaseValue, TReleaseReturn, tReleaseFunction, tExpectedReturnValue, tCheckReturnValue, tInvalidValue > &&scopedObject) noexcept |
| | Move constructor.
|
| | ScopedObjectCompileTimeT (T &&object) noexcept |
| | Creates a new scoped object.
|
| | ScopedObjectCompileTimeT (T &&object, const bool needsRelease) noexcept |
| | Creates a new scoped object.
|
| | ScopedObjectCompileTimeT (const T &object) |
| | Creates a new scoped object.
|
| | ScopedObjectCompileTimeT (const T &object, const bool needsRelease) |
| | Creates a new scoped object.
|
| | ~ScopedObjectCompileTimeT () |
| | Destructs this scoped object and releases the internal wrapped object.
|
| bool | isValid () const |
| | Returns whether this scoped object holds a valid object.
|
| const T & | object () const |
| | Returns the wrapped object.
|
| const T & | operator-> () const |
| | Returns the wrapped object.
|
| const T & | operator* () const |
| | De-reference operator returning the wrapped object.
|
| T & | resetObject (const bool needsRelease=true) |
| | Releases the current wrapped object and returns a new wrapped object.
|
| void | release () |
| | Explicitly releases the wrapped object.
|
| ScopedObjectCompileTimeT< T, TReleaseValue, TReleaseReturn, tReleaseFunction, tExpectedReturnValue, tCheckReturnValue, tInvalidValue > & | operator= (ScopedObjectCompileTimeT< T, TReleaseValue, TReleaseReturn, tReleaseFunction, tExpectedReturnValue, tCheckReturnValue, tInvalidValue > &&scopedObject) noexcept |
| | Move operator.
|
|
| | ScopedObjectCompileTimeT (const ScopedObjectCompileTimeT< T, TReleaseValue, TReleaseReturn, tReleaseFunction, tExpectedReturnValue, tCheckReturnValue, tInvalidValue > &)=delete |
| | Disabled copy constructor.
|
| ScopedObjectCompileTimeT & | operator= (const ScopedObjectCompileTimeT< T, TReleaseValue, TReleaseReturn, tReleaseFunction, tExpectedReturnValue, tCheckReturnValue, tInvalidValue > &)=delete |
| | Disabled assign operator.
|
template<typename T, typename TReleaseValue, typename TReleaseReturn, TReleaseReturn(*)(TReleaseValue) tReleaseFunction, typename
NotVoidTyper< TReleaseReturn >
::Type tExpectedReturnValue = NotVoidTyper<TReleaseReturn>::defaultValue(), bool tCheckReturnValue = true, T tInvalidValue = T()>
class Ocean::ScopedObjectCompileTimeT< T, TReleaseValue, TReleaseReturn, tReleaseFunction, tExpectedReturnValue, tCheckReturnValue, tInvalidValue >
This class wraps an unmanaged object (or reference) which needs to be released after usage.
The release function needs to be defined at compile time.
- Template Parameters
-
| T | The data type of the wrapped object |
| TReleaseValue | The optional explicit data type of the object to be released |
| TReleaseReturn | The data type of the return value of the release function |
| tReleaseFunction | The data type of the release function |
| tExpectedReturnValue | The expected return value of the release function |
| tCheckReturnValue | True, to check the return value when calling the release function; False, to ignore the return value |
| tInvalidValue | The value of an invalid object |
- See also
- ScopedObjectT.