C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
caf::disposable Class Reference

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
 
disposableoperator= (disposable &&) noexcept=default
 
disposableoperator= (const disposable &) noexcept=default
 
void dispose ()
 Disposes the resource.
 
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();.
 
implptr () const noexcept
 Returns a pointer to the implementation.
 
intrusive_ptr< impl > && as_intrusive_ptr () &&noexcept
 Returns a smart pointer to the implementation.
 
intrusive_ptr< implas_intrusive_ptr () const &noexcept
 Returns a smart pointer to the implementation.
 
void swap (disposable &other)
 Exchanges the content of this handle with other.
 

Static Public Member Functions

static disposable make_composite (std::vector< disposable > entries)
 Combines multiple disposables into a single disposable.
 

Detailed Description

Represents a disposable resource.

Member Function Documentation

◆ dispose()

void caf::disposable::dispose ( )

Disposes the resource.

Calling dispose() on a disposed resource is a no-op.

◆ make_composite()

static disposable caf::disposable::make_composite ( std::vector< disposable entries)
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.


The documentation for this class was generated from the following file: