|
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 | |
| ModuleBase () | |
| virtual | ~ModuleBase () |
| virtual State | GetState () const override |
| virtual TTV_ErrorCode | Initialize (const InitializeCallback &callback) override |
| virtual TTV_ErrorCode | Update () override |
| virtual TTV_ErrorCode | Shutdown (const ShutdownCallback &callback) override |
| virtual std::string | GetModuleName () const =0 |
Protected Member Functions | |
| void | NotifyStateChange () |
| void | RegisterInitializeCallback (const InitializeCallback &callback) |
| void | RegisterShutdownCallback (const ShutdownCallback &callback) |
| virtual bool | CheckShutdown () |
| virtual void | CompleteShutdown () |
| template<typename T > | |
| void | Invoke (std::function< void(std::shared_ptr< T >)> callback) |
| std::shared_ptr< ComponentContainer > | GetComponentContainer () |
Protected Attributes | |
| EventSource< IModuleListener > | mListeners |
| State | mState |
| State | mLastReportedState |
Private Attributes | |
| std::shared_ptr< ComponentContainer > | mComponentContainer |
| CallbackQueue< InitializeCallback > | mInitializeCallbacks |
| CallbackQueue< ShutdownCallback > | mShutdownCallbacks |
A base class providing common functionality for modules.
|
inherited |
|
inherited |
|
stronginherited |
| ttv::ModuleBase::ModuleBase | ( | ) |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
|
inlineprotected |
Returns the common ComponentContainer which hosts all components which live at the module level.
|
pure virtualinherited |
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.
|
overridevirtual |
Returns the current state of the module.
Implements ttv::IModule.
|
overridevirtual |
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.
Implements ttv::IModule.
Reimplemented in ttv::chat::ChatAPI, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
|
inlineprotected |
Invokes the callback for the module listeners.
|
protected |
|
inlineprotected |
|
inlineprotected |
|
overridevirtual |
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.
Implements ttv::IModule.
Reimplemented in ttv::chat::ChatAPI, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
|
overridevirtual |
Updates the internal state of the module and fires any pending callbacks.
Implements ttv::IModule.
Reimplemented in ttv::chat::ChatAPI, ttv::CoreAPI, ttv::broadcast::BroadcastAPI, ttv::social::SocialAPI, ttv::experiment::ExperimentAPI, ttv::ads::AdsAPI, and ttv::tracking::TrackingAPI.
|
private |
The set of components that are managed at the module level. This may contain components which have been passed to the client via the public interface.
|
private |
|
protected |
|
protected |
The registered listeners. These listeners extend IModuleListener and will be of the type required for the module.
|
private |
|
protected |
1.8.13