aegis.cpp
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Static Public Member Functions | List of all members
aegis::snowflake Class Reference

Stores creation time and extra data specific to Discord for entities. More...

#include <snowflake.hpp>

Public Member Functions

constexpr snowflake (int64_t _snowflake) noexcept
 
constexpr snowflake (const snowflake &_snowflake) noexcept
 
 snowflake (const char *_snowflake) noexcept
 
 snowflake (const std::string &_snowflake) noexcept
 
 snowflake (const nlohmann::json &_snowflake) noexcept
 
 snowflake (const aegis::user &_user) noexcept
 
 snowflake (const aegis::guild &_guild) noexcept
 
 snowflake (const aegis::channel &_channel) noexcept
 
 snowflake (const aegis::gateway::objects::role &_role) noexcept
 
 snowflake (const aegis::gateway::objects::message &_message) noexcept
 
 snowflake (const aegis::gateway::objects::emoji &_emoji) noexcept
 
 snowflake (const aegis::gateway::objects::attachment &_attachment) noexcept
 
constexpr operator int64_t () const noexcept
 
constexpr int64_t get () const noexcept
 Get snowflake as int64_t. More...
 
std::string gets () const noexcept
 Get snowflake as std::string. More...
 
constexpr std::tuple< int64_t,
int8_t, int8_t, int16_t > 
get_all () const noexcept
 Obtain all the snowflake values as a tuple. More...
 
constexpr int16_t get_count () const noexcept
 
constexpr int8_t get_process () const noexcept
 
constexpr int8_t get_worker () const noexcept
 
constexpr int64_t get_timestamp () const noexcept
 
constexpr int64_t get_time () const noexcept
 

Static Public Member Functions

static constexpr std::tuple
< int64_t, int8_t, int8_t,
int16_t > 
c_get_all (int64_t _snowflake) noexcept
 Obtain all the snowflake values as a tuple. More...
 
static constexpr int16_t c_get_count (int64_t _snowflake) noexcept
 
static constexpr int8_t c_get_process (int64_t _snowflake) noexcept
 
static constexpr int8_t c_get_worker (int64_t _snowflake) noexcept
 
static constexpr int64_t c_get_timestamp (int64_t _snowflake) noexcept
 
static constexpr int64_t c_get_time (int64_t _snowflake) noexcept
 

Detailed Description

Stores creation time and extra data specific to Discord for entities.

Member Function Documentation

static constexpr std::tuple<int64_t, int8_t, int8_t, int16_t> aegis::snowflake::c_get_all ( int64_t  _snowflake)
staticnoexcept

Obtain all the snowflake values as a tuple.

Returns
std::tuple of all the snowflake parts
static constexpr int16_t aegis::snowflake::c_get_count ( int64_t  _snowflake)
staticnoexcept
Returns
int16_t Internal counter for snowflakes
static constexpr int8_t aegis::snowflake::c_get_process ( int64_t  _snowflake)
staticnoexcept
Returns
int8_t Process ID of the snowflake generator
static constexpr int64_t aegis::snowflake::c_get_time ( int64_t  _snowflake)
staticnoexcept
Returns
int64_t Unix timestamp this snowflake was generated
static constexpr int64_t aegis::snowflake::c_get_timestamp ( int64_t  _snowflake)
staticnoexcept
Returns
int64_t The Discord epoch timestamp this snowflake was generated
static constexpr int8_t aegis::snowflake::c_get_worker ( int64_t  _snowflake)
staticnoexcept
Returns
int8_t Worker ID of the snowflake generator
constexpr int64_t aegis::snowflake::get ( ) const
noexcept

Get snowflake as int64_t.

Returns
int64_t Snowflake
constexpr std::tuple<int64_t, int8_t, int8_t, int16_t> aegis::snowflake::get_all ( ) const
noexcept

Obtain all the snowflake values as a tuple.

Returns
std::tuple of all the snowflake parts
constexpr int16_t aegis::snowflake::get_count ( ) const
noexcept
Returns
int16_t Internal counter for snowflakes
constexpr int8_t aegis::snowflake::get_process ( ) const
noexcept
Returns
int8_t Process ID of the snowflake generator
constexpr int64_t aegis::snowflake::get_time ( ) const
noexcept
Returns
int64_t Unix timestamp this snowflake was generated
constexpr int64_t aegis::snowflake::get_timestamp ( ) const
noexcept
Returns
int64_t The Discord epoch timestamp this snowflake was generated
constexpr int8_t aegis::snowflake::get_worker ( ) const
noexcept
Returns
int8_t Worker ID of the snowflake generator
std::string aegis::snowflake::gets ( ) const
noexcept

Get snowflake as std::string.

Returns
std::string Snowflake

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