gpg:: EventManager
#include <event_manager.h>
Gets and sets various event-related data.
Summary
Public types |
|
---|---|
FetchAllCallback
|
typedefstd::function< void(const FetchAllResponse &)>
Defines a callback type that receives a FetchAllResponse . |
FetchCallback
|
typedefstd::function< void(const FetchResponse &)>
Defines a callback type that receives a FetchResponse . |
Public functions |
|
---|---|
Fetch(const std::string & event_id, FetchCallback callback)
|
void
Asynchronously loads data for a specific event for the currently signed-in player.
|
Fetch(DataSource data_source, const std::string & event_id, FetchCallback callback)
|
void
Asynchronously loads data for a specific event for the currently signed-in player Calls the provided
FetchCallback on operation completion. |
FetchAll(FetchAllCallback callback)
|
void
Asynchronously loads all event data for the currently signed-in player.
|
FetchAll(DataSource data_source, FetchAllCallback callback)
|
void
Asynchronously loads all event data for the currently signed-in player.
|
FetchAllBlocking()
|
Synchronously loads all event data for the currently signed-in player, directly returning the
FetchAllResponse . |
FetchAllBlocking(DataSource data_source)
|
Synchronously loads all event data for the currently signed-in player, directly returning the
FetchAllResponse . |
FetchAllBlocking(Timeout timeout)
|
Synchronously loads all event data for the currently signed-in player, directly returning the
FetchAllResponse . |
FetchAllBlocking(DataSource data_source, Timeout timeout)
|
Synchronously loads all event data for the currently signed-in player, directly returning the
FetchAllResponse . |
FetchBlocking(const std::string & event_id)
|
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the
FetchResponse . |
FetchBlocking(DataSource data_source, const std::string & event_id)
|
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the
FetchResponse . |
FetchBlocking(Timeout timeout, const std::string & event_id)
|
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the
FetchResponse . |
FetchBlocking(DataSource data_source, Timeout timeout, const std::string & event_id)
|
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the
FetchResponse . |
Increment(const std::string & event_id)
|
void
Increments an event by 1.
|
Increment(const std::string & event_id, uint32_t steps)
|
void
Increments an event by the given number of steps.
|
Structs |
|
---|---|
gpg:: |
|
gpg:: |
Contains data and response status for a single event. |
Public types
FetchAllCallback
std::function< void(const FetchAllResponse &)> FetchAllCallback
Defines a callback type that receives a FetchAllResponse
.
This callback type is provided to the FetchAll(*)
functions below.
FetchCallback
std::function< void(const FetchResponse &)> FetchCallback
Defines a callback type that receives a FetchResponse
.
This callback type is provided to the Fetch(*)
functions below.
Public functions
Fetch
void Fetch( const std::string & event_id, FetchCallback callback )
Asynchronously loads data for a specific event for the currently signed-in player.
Calls the provided FetchCallback
on operation completion. Not specifying data_source
makes this function call equivalent to calling Fetch(DataSource data_source, const std::string& event_id,
FetchCallback)
, with data_source
specified as CACHE_OR_NETWORK
.
Fetch
void Fetch( DataSource data_source, const std::string & event_id, FetchCallback callback )
Asynchronously loads data for a specific event for the currently signed-in player Calls the provided FetchCallback
on operation completion.
Specify data_source
as CACHE_OR_NETWORK
or NETWORK_ONLY
.
FetchAll
void FetchAll( FetchAllCallback callback )
Asynchronously loads all event data for the currently signed-in player.
Calls the provided FetchAllCallback
on operation completion. Not specifying data_source
makes this function call equivalent to calling FetchAll(DataSource data_source, FetchAllCallback)
, with data_source
specified as CACHE_OR_NETWORK
.
FetchAll
void FetchAll( DataSource data_source, FetchAllCallback callback )
Asynchronously loads all event data for the currently signed-in player.
Calls the provided FetchAllCallback
on operation completion. Specify data_source as CACHE_OR_NETWORK
or NETWORK_ONLY
.
FetchAllBlocking
FetchAllResponse FetchAllBlocking()
Synchronously loads all event data for the currently signed-in player, directly returning the FetchAllResponse
.
Specifying neither data_source
nor timeout
makes this function call equivalent to calling FetchAllResponse FetchAllBlocking(DataSource data_source,
Timeout timeout)
, with data_source
specified as CACHE_OR_NETWORK
, and timeout
specified as 10 years.
FetchAllBlocking
FetchAllResponse FetchAllBlocking( DataSource data_source )
Synchronously loads all event data for the currently signed-in player, directly returning the FetchAllResponse
.
Specify data_source
as CACHE_OR_NETWORK
or NETWORK_ONLY
. Not specifying timeout makes this function call equivalent to calling FetchAllResponse FetchAllBlocking(DataSource data_source
, Timeout timeout)
, with your specified data_source
value, and timeout
specified as 10 years.
FetchAllBlocking
FetchAllResponse FetchAllBlocking( Timeout timeout )
Synchronously loads all event data for the currently signed-in player, directly returning the FetchAllResponse
.
Specify timeout
as an arbitrary number of milliseconds. Not specifying data_source
makes this function call equivalent to calling FetchAllResponse FetchAllBlocking(DataSource data_source,
Timeout timeout)
, with data_source
specified as CACHE_OR_NETWORK
, and timeout
containing your specified value.
FetchAllBlocking
FetchAllResponse FetchAllBlocking( DataSource data_source, Timeout timeout )
Synchronously loads all event data for the currently signed-in player, directly returning the FetchAllResponse
.
Specify data_source
as CACHE_OR_NETWORK
or NETWORK_ONLY
. Specify timeout
as an arbitrary number of milliseconds.
FetchBlocking
FetchResponse FetchBlocking( const std::string & event_id )
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the FetchResponse
.
Leaving data_source
and timeout
unspecified makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source,
Timeout timeout, const std::string& event_id)
, with data_source
specified as CACHE_OR_NETWORK
, and timeout
specified as 10 years.
FetchBlocking
FetchResponse FetchBlocking( DataSource data_source, const std::string & event_id )
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the FetchResponse
.
Specify data_source
as CACHE_OR_NETWORK
or NETWORK_ONLY
. Leaving timeout
unspecified makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source,
Timeout timeout, const std::string& event_id)
, with your specified data_source
value, and timeout
specified as 10 years.
FetchBlocking
FetchResponse FetchBlocking( Timeout timeout, const std::string & event_id )
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the FetchResponse
.
Specify timeout
as an arbitrary number of milliseconds. Leaving data_source
unspecified makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source,
Timeout timeout, const std::string& event_id)
, with data_source
specified as CACHE_OR_NETWORK
, and timeout
containing your specified value.
FetchBlocking
FetchResponse FetchBlocking( DataSource data_source, Timeout timeout, const std::string & event_id )
Synchronously loads data for a specific event, identified by string id, for the currently signed-in player; directly returns the FetchResponse
.
Specify DataSource
as CACHE_OR_NETWORK
or NETWORK_ONLY
. Specify timeout
as an arbitrary number of milliseconds.
Increment
void Increment( const std::string & event_id )
Increments an event by 1.
Increment
void Increment( const std::string & event_id, uint32_t steps )
Increments an event by the given number of steps.