D++ (DPP)
C++ Discord API Bot Library
Loading...
Searching...
No Matches
dpp::role_collector Class Referenceabstract

Role collector. Collects guild roles during a set timeframe and returns them in a list via the completed() method. More...

#include <collector.h>

Inheritance diagram for dpp::role_collector:
Collaboration diagram for dpp::role_collector:

Public Member Functions

 role_collector (cluster *cl, uint64_t duration)
 Construct a new role collector object.
virtual ~role_collector ()=default
 Destroy the role collector object.
virtual void cancel ()
 Immediately cancels the collector.
virtual void completed (const std::vector< dpp::role > &list)=0
 Return the completed collection.
virtual const dpp::rolefilter (const dpp::guild_role_create_t &element)
 Select and filter the items which are to appear in the list This is called every time a new event is fired, to filter the event and determine which of the items is sent to the list. Returning nullptr excludes the item from the list.

Protected Attributes

class clusterowner
 Owning cluster.

Detailed Description

Role collector. Collects guild roles during a set timeframe and returns them in a list via the completed() method.

Constructor & Destructor Documentation

◆ role_collector()

dpp::role_collector::role_collector ( cluster * cl,
uint64_t duration )
inline

Construct a new role collector object.

Parameters
clcluster to associate the collector with
durationDuration of time to run the collector for in seconds

◆ ~role_collector()

virtual dpp::role_collector::~role_collector ( )
virtualdefault

Destroy the role collector object.

Member Function Documentation

◆ cancel()

virtual void dpp::collector< dpp::guild_role_create_t, dpp::role >::cancel ( )
inlinevirtualinherited

Immediately cancels the collector.

Use this if you have met the conditions for which you are collecting objects early, e.g. you were watching for a message containing 'yes' or 'no' and have received it before the time is up.

Note
Causes calling of the completed() method if it has not yet been called.

◆ completed()

virtual void dpp::role_collector::completed ( const std::vector< dpp::role > & list)
pure virtual

Return the completed collection.

Parameters
listitems collected during the timeframe specified

Implements dpp::collector< dpp::guild_role_create_t, dpp::role >.

◆ filter()

virtual const dpp::role * dpp::role_collector::filter ( const dpp::guild_role_create_t & element)
inlinevirtual

Select and filter the items which are to appear in the list This is called every time a new event is fired, to filter the event and determine which of the items is sent to the list. Returning nullptr excludes the item from the list.

Parameters
elementelement to filter
Returns
Returned item to add to the list, or nullptr to skip adding this element

Implements dpp::collector< dpp::guild_role_create_t, dpp::role >.

Member Data Documentation

◆ owner

class cluster* dpp::collector< dpp::guild_role_create_t, dpp::role >::owner
protectedinherited

Owning cluster.

D++ 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