WeakPluginPtr is a non-reference-holding smart pointer for a Plugin. WeakPluginPtr is analogous to std::weak_ptr where PluginPtr is analogous to std::shared_ptr. More...
#include <WeakPluginPtr.hh>
Public Member Functions | |
WeakPluginPtr () | |
Default constructor. | |
WeakPluginPtr (const PluginPtr &_ptr) | |
Construct from a live PluginPtr. | |
WeakPluginPtr (const WeakPluginPtr &_other) | |
Copy constructor. | |
WeakPluginPtr (WeakPluginPtr &&_other) | |
Move constructor. | |
~WeakPluginPtr () | |
Destructor. | |
bool | IsExpired () const |
Check whether the referenced Plugin has already expired. | |
PluginPtr | Lock () const |
Retrieve the PluginPtr that this WeakPluginPtr refers to, if it is still available. Otherwise, retrieve an empty PluginPtr. | |
WeakPluginPtr & | operator= (const PluginPtr &_ptr) |
Assign from a live PluginPtr. | |
WeakPluginPtr & | operator= (const WeakPluginPtr &_other) |
Copy assignment operator. | |
WeakPluginPtr & | operator= (WeakPluginPtr &&_other) |
Move assignment operator. | |
Detailed Description
WeakPluginPtr is a non-reference-holding smart pointer for a Plugin. WeakPluginPtr is analogous to std::weak_ptr where PluginPtr is analogous to std::shared_ptr.
Use Lock() to receive a reference-holding PluginPtr that points to the Plugin that this WeakPluginPtr is meant to reference.
If the Plugin is deleted while this WeakPluginPtr is referring to it, then Lock() will return an empty PluginPtr, and IsExpired() will return true.
Constructor & Destructor Documentation
◆ WeakPluginPtr() [1/4]
WeakPluginPtr | ( | ) |
Default constructor.
◆ WeakPluginPtr() [2/4]
WeakPluginPtr | ( | const WeakPluginPtr & | _other | ) |
Copy constructor.
- Parameters
-
[in] _other Another WeakPluginPtr to copy
◆ WeakPluginPtr() [3/4]
WeakPluginPtr | ( | WeakPluginPtr && | _other | ) |
Move constructor.
- Parameters
-
[in] _other Another WeakPluginPtr to move from
◆ WeakPluginPtr() [4/4]
WeakPluginPtr | ( | const PluginPtr & | _ptr | ) |
◆ ~WeakPluginPtr()
~WeakPluginPtr | ( | ) |
Destructor.
Member Function Documentation
◆ IsExpired()
bool IsExpired | ( | ) | const |
Check whether the referenced Plugin has already expired.
- Returns
- true if this PluginPtr is expired, false otherwise.
◆ Lock()
PluginPtr Lock | ( | ) | const |
Retrieve the PluginPtr that this WeakPluginPtr refers to, if it is still available. Otherwise, retrieve an empty PluginPtr.
- Returns
- The PluginPtr that this WeakPluginPtr refers to.
◆ operator=() [1/3]
WeakPluginPtr & operator= | ( | const PluginPtr & | _ptr | ) |
◆ operator=() [2/3]
WeakPluginPtr & operator= | ( | const WeakPluginPtr & | _other | ) |
Copy assignment operator.
- Parameters
-
[in] _other Another WeakPluginPtr to copy
- Returns
- reference to this
◆ operator=() [3/3]
WeakPluginPtr & operator= | ( | WeakPluginPtr && | _other | ) |
Move assignment operator.
- Parameters
-
[in] _other Another WeakPluginPtr to move from
- Returns
- reference to this
The documentation for this class was generated from the following file: