C++ Actor Framework 1.0.0
|
Represents a disposable resource. More...
#include <disposable.hpp>
Classes | |
class | impl |
Internal implementation class of a disposable . More... | |
Public Member Functions | |
disposable (intrusive_ptr< impl > pimpl) noexcept | |
disposable (disposable &&) noexcept=default | |
disposable (const disposable &) noexcept=default | |
disposable & | operator= (disposable &&) noexcept=default |
disposable & | operator= (const disposable &) noexcept=default |
disposable & | operator= (std::nullptr_t) noexcept |
void | dispose () |
Disposes the resource. | |
void | swap (disposable &other) |
Exchanges the content of this handle with other . | |
bool | disposed () const noexcept |
Returns whether the resource has been disposed. | |
bool | valid () const noexcept |
Returns whether this handle still points to a resource. | |
operator bool () const noexcept | |
Returns valid() ;. | |
bool | operator! () const noexcept |
Returns !valid() ;. | |
impl * | ptr () const noexcept |
Returns a pointer to the implementation. | |
intrusive_ptr< impl > && | as_intrusive_ptr () &&noexcept |
Returns a smart pointer to the implementation. | |
intrusive_ptr< impl > | as_intrusive_ptr () const &noexcept |
Returns a smart pointer to the implementation. | |
intptr_t | compare (const disposable &other) const noexcept |
Compares the internal pointers. | |
Static Public Member Functions | |
static disposable | make_composite (std::vector< disposable > entries) |
Combines multiple disposables into a single disposable. | |
static disposable | make_flag () |
Creates a disposable that simply represents a flag. | |
static size_t | erase_disposed (std::vector< disposable > &xs) |
Erases each x from xs where x.disposed() . | |
Related Symbols | |
(Note that these are not member symbols.) | |
using | disposable_impl = disposable::impl |
Represents a disposable resource.
void caf::disposable::dispose | ( | ) |
Disposes the resource.
Calling dispose()
on a disposed resource is a no-op.
|
static |
Erases each x
from xs
where x.disposed()
.
|
static |
Combines multiple disposables into a single disposable.
The new disposable is disposed if all of its elements are disposed. Disposing the composite disposes all elements individually.