The managed class is the base class for various types that can be stored in a cache that are identified by a dpp::snowflake id.
More...
#include <managed.h>
|
| | managed ()=default |
| | Constructor, initialises id to 0.
|
| | managed (const managed &rhs)=default |
| | Copy constructor.
|
| | managed (const snowflake nid) |
| | Constructor, initialises ID.
|
| | managed (managed &&rhs)=default |
| | Move constructor.
|
| virtual | ~managed ()=default |
| | Destroy the managed object.
|
| constexpr double | get_creation_time () const noexcept |
| | Get the creation time of this object according to Discord.
|
| constexpr bool | operator!= (const managed &other) const noexcept |
| | Comparison operator for comparing two managed objects by id.
|
| managed & | operator= (const managed &rhs)=default |
| | Copy assignment operator.
|
| managed & | operator= (managed &&rhs)=default |
| | Move assignment operator.
|
| constexpr bool | operator== (const managed &other) const noexcept |
| | Comparison operator for comparing two managed objects by id.
|
|
| snowflake | id = {} |
| | Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.
|
The managed class is the base class for various types that can be stored in a cache that are identified by a dpp::snowflake id.
◆ managed() [1/4]
| dpp::managed::managed |
( |
| ) |
|
|
default |
Constructor, initialises id to 0.
◆ managed() [2/4]
Constructor, initialises ID.
- Parameters
-
◆ managed() [3/4]
| dpp::managed::managed |
( |
const managed & | rhs | ) |
|
|
default |
Copy constructor.
- Parameters
-
◆ managed() [4/4]
| dpp::managed::managed |
( |
managed && | rhs | ) |
|
|
default |
Move constructor.
Effectively equivalent to copy constructor
- Parameters
-
◆ ~managed()
| virtual dpp::managed::~managed |
( |
| ) |
|
|
virtualdefault |
Destroy the managed object.
◆ get_creation_time()
| double dpp::managed::get_creation_time |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the creation time of this object according to Discord.
- Returns
- double creation time inferred from the snowflake ID. The minimum possible value is the first second of 2015.
◆ operator!=()
| bool dpp::managed::operator!= |
( |
const managed & | other | ) |
const |
|
inlineconstexprnoexcept |
Comparison operator for comparing two managed objects by id.
- Parameters
-
| other | Other object to compare against |
- Returns
- true objects are not the same id
-
false objects are the same id
◆ operator=() [1/2]
Copy assignment operator.
- Parameters
-
◆ operator=() [2/2]
Move assignment operator.
- Parameters
-
◆ operator==()
| bool dpp::managed::operator== |
( |
const managed & | other | ) |
const |
|
inlineconstexprnoexcept |
Comparison operator for comparing two managed objects by id.
- Parameters
-
| other | Other object to compare against |
- Returns
- true objects are the same id
-
false objects are not the same id
◆ id
Unique ID of object set by Discord. This value contains a timestamp, worker ID, internal server ID, and an incrementing value. Only the timestamp is relevant to us as useful metadata.