SyDEVS
v0.6.7
Multiscale Simulation and Systems Modeling Library
|
A data type which represents a pointer to anything. More...
#include <pointer.h>
Public Member Functions | |
pointer () noexcept | |
Constructs a null pointer instance. More... | |
pointer (std::nullptr_t X) noexcept | |
Constructs a null pointer instance from a nullptr . More... | |
template<typename T > | |
pointer (T *ptr) | |
Constructs a pointer instance referencing the same data as ptr . More... | |
pointer (const pointer &) noexcept=default | |
Copy constructor. More... | |
pointer & | operator= (const pointer &) noexcept=default |
Copy assignment. More... | |
pointer (pointer &&) noexcept=default | |
Move constructor. More... | |
pointer & | operator= (pointer &&) noexcept=default |
Move assignment. More... | |
~pointer ()=default | |
Destructor. More... | |
void | reset () noexcept |
Modifies the pointer to reference nullptr . More... | |
template<typename T > | |
void | reset (T *ptr) |
Modifies the pointer to reference the same data as ptr . More... | |
template<typename T > | |
T & | dereference () const |
Returns the referenced data, casting it to type T . More... | |
operator bool () const noexcept | |
Returns true if the pointer does not reference nullptr . More... | |
A data type which represents a pointer to anything.
A pointer
instance encapsulates std::shared_ptr<void>
, which is essentially a reference-counted pointer to any type of data. The example below demonstrates how to use the class.
|
inlinenoexcept |
Constructs a null pointer
instance.
|
inlineexplicitnoexcept |
Constructs a null pointer
instance from a nullptr
.
|
inlineexplicit |
Constructs a pointer
instance referencing the same data as ptr
.
|
defaultnoexcept |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Destructor.
|
inline |
Returns the referenced data, casting it to type T
.
|
inlineexplicitnoexcept |
Returns true
if the pointer does not reference nullptr
.
|
inlinenoexcept |
Modifies the pointer to reference nullptr
.
|
inline |
Modifies the pointer to reference the same data as ptr
.