D++ (DPP)  10.0.30
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 ()=default
 Constructor, initialises id to 0. More...
 
 managed (const managed &rhs)=default
 Copy constructor. More...
 
 managed (const snowflake nid)
 Constructor, initialises ID. More...
 
 managed (managed &&rhs)=default
 Move constructor. More...
 
virtual ~managed ()=default
 Destroy the managed object. More...
 
constexpr double get_creation_time () const noexcept
 Get the creation time of this object according to Discord. More...
 
constexpr bool operator!= (const managed &other) const noexcept
 Comparison operator for comparing two managed objects by id. More...
 
managedoperator= (const managed &rhs)=default
 Copy assignment operator. More...
 
managedoperator= (managed &&rhs)=default
 Move assignment operator. More...
 
constexpr 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. 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() [1/4]

dpp::managed::managed ( )
default

Constructor, initialises id to 0.

◆ managed() [2/4]

dpp::managed::managed ( const snowflake  nid)
inline

Constructor, initialises ID.

Parameters
nidID to set

◆ managed() [3/4]

dpp::managed::managed ( const managed rhs)
default

Copy constructor.

Parameters
rhsObject to copy

◆ managed() [4/4]

dpp::managed::managed ( managed &&  rhs)
default

Move constructor.

Effectively equivalent to copy constructor

Parameters
rhsObject to move from

◆ ~managed()

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

Destroy the managed object.

Member Function Documentation

◆ 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
otherOther object to compare against
Returns
true objects are not the same id
false objects are the same id

◆ operator=() [1/2]

managed& dpp::managed::operator= ( const managed rhs)
default

Copy assignment operator.

Parameters
rhsObject to copy

◆ operator=() [2/2]

managed& dpp::managed::operator= ( managed &&  rhs)
default

Move assignment operator.

Parameters
rhsObject to move from

◆ operator==()

constexpr bool dpp::managed::operator== ( const managed other) const
inlineconstexprnoexcept

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


The documentation for this class was generated from the following file: