|
libzypp
15.3.0
|
Reference counted access to a _Tp object calling a custom Dispose function when the last AutoDispose handle to it is destroyed or reset.
More...
#include <AutoDispose.h>
Classes | |
| struct | Impl |
Public Types | |
| typedef boost::call_traits< _Tp >::param_type | param_type |
| typedef boost::call_traits< _Tp >::reference | reference |
| typedef boost::call_traits< _Tp >::const_reference | const_reference |
| typedef _Tp | value_type |
| typedef boost::call_traits< _Tp >::value_type | result_type |
| typedef function< void(param_type)> | Dispose |
| Dispose function signatue. More... | |
Public Member Functions | |
| AutoDispose () | |
| Default Ctor using default constructed value and no dispose function. More... | |
| AutoDispose (const Dispose &dispose_r) | |
| Ctor taking dispose function and using default constructed value. More... | |
| AutoDispose (param_type value_r) | |
| Ctor taking value and no dispose function. More... | |
| AutoDispose (param_type value_r, const Dispose &dispose_r) | |
| Ctor taking value and dispose function. More... | |
| operator reference () const | |
Provide implicit conversion to _Tp&. More... | |
| reference | value () const |
Reference to the _Tp object. More... | |
| reference | operator* () const |
Reference to the _Tp object. More... | |
| value_type * | operator-> () const |
Pointer to the _Tp object (asserted to be != NULL). More... | |
| void | reset () |
| Reset to default Ctor values. More... | |
| void | swap (AutoDispose &rhs) |
| Exchange the contents of two AutoDispose objects. More... | |
| const Dispose & | getDispose () const |
| Return the current dispose function. More... | |
| void | setDispose (const Dispose &dispose_r) |
| Set a new dispose function. More... | |
| void | resetDispose () |
| Set no dispose function. More... | |
| void | swapDispose (Dispose &dispose_r) |
| Exchange the dispose function. More... | |
Private Attributes | |
| shared_ptr< Impl > | _pimpl |
Related Functions | |
(Note that these are not member functions.) | |
| template<class _Tp > | |
| std::ostream & | operator<< (std::ostream &str, const AutoDispose< _Tp > &obj) |
Reference counted access to a _Tp object calling a custom Dispose function when the last AutoDispose handle to it is destroyed or reset.
AutoDispose object does not apply to the stored _Tp object. If the stored _Tp object should be immutable, you should use AutoDispose<const _Tp>.Pass a filename to the application and provide the appropriate code to be executed when the file is no longer needed:
Exception safe handling of temporary files:
Definition at line 92 of file AutoDispose.h.
| typedef boost::call_traits<_Tp>::param_type zypp::AutoDispose< _Tp >::param_type |
Definition at line 95 of file AutoDispose.h.
| typedef boost::call_traits<_Tp>::reference zypp::AutoDispose< _Tp >::reference |
Definition at line 96 of file AutoDispose.h.
| typedef boost::call_traits<_Tp>::const_reference zypp::AutoDispose< _Tp >::const_reference |
Definition at line 97 of file AutoDispose.h.
| typedef _Tp zypp::AutoDispose< _Tp >::value_type |
Definition at line 98 of file AutoDispose.h.
| typedef boost::call_traits<_Tp>::value_type zypp::AutoDispose< _Tp >::result_type |
Definition at line 99 of file AutoDispose.h.
| typedef function<void ( param_type )> zypp::AutoDispose< _Tp >::Dispose |
Dispose function signatue.
Definition at line 103 of file AutoDispose.h.
|
inline |
Default Ctor using default constructed value and no dispose function.
Definition at line 107 of file AutoDispose.h.
|
inlineexplicit |
Ctor taking dispose function and using default constructed value.
Definition at line 112 of file AutoDispose.h.
|
inlineexplicit |
Ctor taking value and no dispose function.
Definition at line 117 of file AutoDispose.h.
|
inline |
Ctor taking value and dispose function.
Definition at line 122 of file AutoDispose.h.
|
inline |
Provide implicit conversion to _Tp&.
Definition at line 129 of file AutoDispose.h.
|
inline |
Reference to the _Tp object.
Definition at line 133 of file AutoDispose.h.
|
inline |
Reference to the _Tp object.
Definition at line 137 of file AutoDispose.h.
|
inline |
Pointer to the _Tp object (asserted to be != NULL).
Definition at line 141 of file AutoDispose.h.
|
inline |
Reset to default Ctor values.
Definition at line 145 of file AutoDispose.h.
|
inline |
Exchange the contents of two AutoDispose objects.
Definition at line 149 of file AutoDispose.h.
|
inline |
Return the current dispose function.
Definition at line 154 of file AutoDispose.h.
|
inline |
Set a new dispose function.
Definition at line 158 of file AutoDispose.h.
|
inline |
Set no dispose function.
Definition at line 162 of file AutoDispose.h.
|
inline |
|
related |
<_Tp> Stream output of the _Tp object.
Definition at line 194 of file AutoDispose.h.
|
private |
Definition at line 188 of file AutoDispose.h.