|
Twitch SDK (Internal)
|
#include <module.h>
Public Types | |
| enum | State { State::Uninitialized, State::Initializing, State::Initialized, State::ShuttingDown } |
| using | InitializeCallback = std::function< void(TTV_ErrorCode ec)> |
| using | ShutdownCallback = std::function< void(TTV_ErrorCode ec)> |
Public Member Functions | |
| virtual | ~IModule () |
| virtual State | GetState () const =0 |
| virtual std::string | GetModuleName () const =0 |
| virtual TTV_ErrorCode | Initialize (const InitializeCallback &callback)=0 |
| virtual TTV_ErrorCode | Update ()=0 |
| virtual TTV_ErrorCode | Shutdown (const ShutdownCallback &callback)=0 |
The interface to be implemented by all modules that exist in the Twitch SDK.
Clients should not consider the module to be thread safe unless a method explicitly says it is. Thus, all calls into a module should be made on the same thread.
| using ttv::IModule::InitializeCallback = std::function<void(TTV_ErrorCode ec)> |
| using ttv::IModule::ShutdownCallback = std::function<void(TTV_ErrorCode ec)> |
|
strong |
|
virtual |
|
pure virtual |
Returns the name of the module.
Implemented in ttv::chat::ChatAPI, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
|
pure virtual |
Returns the current state of the module.
Implemented in ttv::ModuleBase.
|
pure virtual |
Initializes the module asynchronously. The module state will be reported in IModuleListener::ModuleStateChanged(). No other calls should be made into the module until the module state is either State::Initialized or State::Uninitialized. You should only expect changes to the module state if this method succeeds.
Implemented in ttv::chat::ChatAPI, ttv::ModuleBase, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
|
pure virtual |
Initiates an asynchronous shutdown of the module. The module state will be reported in IModuleListener::ModuleStateChanged(). No other calls should be made into the module until the module state is either State::Initialized or State::Uninitialized. All modules that depend on this module need to be shutdown first. You should only expect changes to the module state if this method succeeds.
Implemented in ttv::chat::ChatAPI, ttv::ModuleBase, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
|
pure virtual |
Updates the internal state of the module and fires any pending callbacks.
Implemented in ttv::chat::ChatAPI, ttv::ModuleBase, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
1.8.13