Twitch SDK (Internal)
Public Types | Public Member Functions | List of all members
ttv::IModule Class Referenceabstract

#include <module.h>

Inheritance diagram for ttv::IModule:
ttv::ModuleBase ttv::ads::AdsAPI ttv::broadcast::BroadcastAPI ttv::chat::ChatAPI ttv::CoreAPI ttv::experiment::ExperimentAPI ttv::social::SocialAPI ttv::tracking::TrackingAPI

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
 

Detailed Description

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.

Member Typedef Documentation

◆ InitializeCallback

using ttv::IModule::InitializeCallback = std::function<void(TTV_ErrorCode ec)>

◆ ShutdownCallback

using ttv::IModule::ShutdownCallback = std::function<void(TTV_ErrorCode ec)>

Member Enumeration Documentation

◆ State

enum ttv::IModule::State
strong
Enumerator
Uninitialized 
Initializing 
Initialized 
ShuttingDown 

Constructor & Destructor Documentation

◆ ~IModule()

virtual ttv::IModule::~IModule ( )
virtual

Member Function Documentation

◆ GetModuleName()

virtual std::string ttv::IModule::GetModuleName ( ) const
pure virtual

◆ GetState()

virtual State ttv::IModule::GetState ( ) const
pure virtual

Returns the current state of the module.

Implemented in ttv::ModuleBase.

◆ Initialize()

virtual TTV_ErrorCode ttv::IModule::Initialize ( const InitializeCallback callback)
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.

◆ Shutdown()

virtual TTV_ErrorCode ttv::IModule::Shutdown ( const ShutdownCallback callback)
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.

◆ Update()

virtual TTV_ErrorCode ttv::IModule::Update ( )
pure virtual

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