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>
|
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. More...
|
|
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()
constexpr 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!=()
constexpr 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==()
constexpr 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.