D++ (DPP)
C++ Discord API Bot Library
dpp::managed Class Reference

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>

+ Inheritance diagram for dpp::managed:
+ Collaboration diagram for dpp::managed:

Public Member Functions

 managed (const snowflake nid=0)
 Constructor, initialises ID. More...
 
virtual ~managed ()=default
 Destroy the managed object. More...
 
double get_creation_time () const
 Get the creation time of this object according to Discord. More...
 
bool operator== (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 
bool operator!= (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 

Public Attributes

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ managed()

dpp::managed::managed ( const snowflake  nid = 0)

Constructor, initialises ID.

Parameters
nidID to set

◆ ~managed()

virtual dpp::managed::~managed ( )
virtualdefault

Destroy the managed object.

Member Function Documentation

◆ get_creation_time()

double dpp::managed::get_creation_time ( ) const

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
noexcept

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are not the same id
false objects are the same id

◆ operator==()

bool dpp::managed::operator== ( const managed other) const
noexcept

Comparison operator for comparing two managed objects by id.

Parameters
otherOther object to compare against
Returns
true objects are the same id
false objects are not the same id

Member Data Documentation

◆ id

snowflake dpp::managed::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.

D++ Library version 10.0.19D++ Library version 10.0.18D++ Library version 10.0.17D++ Library version 10.0.16D++ Library version 10.0.15D++ Library version 10.0.14D++ Library version 10.0.13D++ Library version 10.0.12D++ Library version 10.0.11D++ Library version 10.0.10D++ Library version 10.0.9D++ Library version 10.0.8D++ Library version 10.0.7D++ Library version 10.0.6D++ Library version 10.0.5D++ Library version 10.0.4D++ Library version 10.0.3D++ Library version 10.0.2D++ Library version 10.0.1D++ Library version 10.0.0D++ Library version 9.0.19D++ Library version 9.0.18D++ Library version 9.0.17D++ Library version 9.0.16D++ Library version 9.0.15D++ Library version 9.0.14D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0