Template Class external

Class Documentation

template<class T>
class external

This class template manages an external member, a member declared to be external to the storage of a type.

Public Types

using type = T

Public Functions

external() = default

Default constructor.

inline external(T *pointer, bool locked = false) noexcept

Constructor from a pointer.

inline external(std::shared_ptr<T> pointer) noexcept

Constructor from a shared pointer.

inline external(const external<T> &other) noexcept

Copy constructor.

inline external<T> &operator=(const external<T> &other)

Assignment.

~external() = default

Destructor.

inline T &operator*() noexcept

Dereference object.

inline const T &operator*() const noexcept

Dereference object.

inline T *get() noexcept

Get pointer.

inline const T *get() const noexcept

Get pointer.

inline std::shared_ptr<T> get_shared_ptr() noexcept

Get shared pointer.

inline T *operator->() noexcept

Dereference object member.

inline const T *operator->() const noexcept

Dereference object member.

inline bool operator==(const external<T> &other) const

Compares they manage the same object or empty both.

inline bool operator!=(const external<T> &other) const

Compares they don’t manages the same object.

inline operator bool() const noexcept

Checks if not null.

inline bool is_locked() const noexcept

Checks if locked.

inline void lock() noexcept

Locks the managed object.