Twitch SDK (Internal)
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ttv::chat::BitsStatus Class Reference

#include <bitsstatus.h>

Inheritance diagram for ttv::chat::BitsStatus:
ttv::PubSubComponent< IBitsListener > ttv::chat::IBitsStatus ttv::PubSubComponentBase ttv::UserComponent ttv::Component ttv::IComponent

Public Types

using DisposerFunc = std::function< void()>
 
enum  State { State::Uninitialized, State::Initialized, State::ShuttingDown, State::Inert }
 

Public Member Functions

 BitsStatus (const std::shared_ptr< User > &user, ChannelId channelId)
 
virtual std::string GetLoggerName () const override
 
virtual TTV_ErrorCode Initialize () override
 
virtual TTV_ErrorCode Shutdown () override
 
virtual void Update () override
 
virtual TTV_ErrorCode Dispose () override
 
void SetTokenizationOptions (const TokenizationOptions &tokenizationOptions)
 
void SetBitsConfigRepository (const std::shared_ptr< BitsConfigRepository > &bitsConfigRepository)
 
void OnTopicSubscribeStateChanged (const std::string &topic, PubSubClient::SubscribeState::Enum state, TTV_ErrorCode ec) override
 
void OnTopicMessageReceived (const std::string &topic, const json::Value &msg) override
 
virtual void CompleteShutdown () override
 
void SetListener (const std::shared_ptr< IBitsListener > &listener)
 
void SetDisposer (DisposerFunc &&func)
 
virtual void OnTopicListenerRemoved (const std::string &topic, TTV_ErrorCode ec)
 
virtual void SetTaskRunner (std::shared_ptr< TaskRunner > taskRunner)
 
std::shared_ptr< TaskRunnerGetTaskRunner ()
 
virtual State GetState () const override
 

Static Public Member Functions

static std::string GetComponentName ()
 

Protected Member Functions

virtual bool CheckShutdown () override
 
virtual void AddTopic (const std::string &topic)
 
virtual TTV_ErrorCode SubscribeTopics ()
 
virtual void OnUserLogInComplete (TTV_ErrorCode ec)
 
virtual void OnUserLogOutComplete (TTV_ErrorCode ec)
 
virtual void OnUserInfoFetchComplete (TTV_ErrorCode ec)
 
virtual void OnUserAuthenticationIssue (std::shared_ptr< const OAuthToken > oauthToken, TTV_ErrorCode ec)
 
void Log (TTV_MessageLevel level, const char *format,...)
 
TTV_ErrorCode StartTask (std::shared_ptr< Task > task)
 
void CompleteTask (Task *task)
 
bool IsTaskRunning (Task *task) const
 
virtual void SetState (State state)
 
virtual void SetClientState (State state)
 
virtual void SetServerState (State state)
 

Protected Attributes

std::shared_ptr< IBitsListenermListener
 
std::shared_ptr< PubSubClientmPubSub
 
std::shared_ptr< PubSubTopicListenermPubSubTopicListener
 
std::shared_ptr< PubSubTopicListenerHelpermPubSubTopicListenerHelper
 
DisposerFunc mDisposerFunc
 
std::vector< std::string > mPubSubTopics
 
std::weak_ptr< UsermUser
 
bool mOAuthIssue
 Whether or not the internal updates of the component are on hold because of an issue with the OAuth token. More...
 
ClientServerValue< StatemState
 
std::shared_ptr< TaskRunnermTaskRunner
 
std::vector< std::shared_ptr< Task > > mRunningTasks
 
std::mutex mTaskMutex
 
uint64_t mShutdownTimeMilliseconds
 

Private Member Functions

void ParseBitsReceivedMessage (const ttv::json::Value &jBitsMessage, BitsReceivedEvent &event)
 
TTV_ErrorCode FetchBitsConfig ()
 

Private Attributes

std::shared_ptr< BitsConfigRepositorymBitsConfigRepository
 
std::shared_ptr< BitsConfigurationmBitsConfiguration
 
RetryTimer mFetchBitsConfigRetryTimer
 
std::string mChannelBitsPubSubTopic
 
std::string mUserBitsPubSubTopic
 
TokenizationOptions mTokenizationOptions
 
ChannelId mChannelId
 
bool mBitsConfigFetchInFlight
 
bool mHasFetchedBitsConfig
 

Detailed Description

A concrete implemenation of IBitsStatus.

Member Typedef Documentation

◆ DisposerFunc

using ttv::chat::BitsStatus::DisposerFunc = std::function<void()>

Member Enumeration Documentation

◆ State

enum ttv::IComponent::State
stronginherited
Enumerator
Uninitialized 
Initialized 
ShuttingDown 
Inert 

The component doesn't require shutting down.

Constructor & Destructor Documentation

◆ BitsStatus()

ttv::chat::BitsStatus::BitsStatus ( const std::shared_ptr< User > &  user,
ChannelId  channelId 
)

Member Function Documentation

◆ AddTopic()

virtual void ttv::PubSubComponentBase::AddTopic ( const std::string &  topic)
protectedvirtualinherited

◆ CheckShutdown()

virtual bool ttv::PubSubComponentBase::CheckShutdown ( )
overrideprotectedvirtualinherited

Reimplemented from ttv::Component.

Reimplemented in ttv::ChannelStatus, and ttv::ProfileImageStatus.

◆ CompleteShutdown()

virtual void ttv::PubSubComponent< IBitsListener >::CompleteShutdown ( )
inlineoverridevirtualinherited

Reimplemented from ttv::PubSubComponentBase.

◆ CompleteTask()

void ttv::Component::CompleteTask ( Task task)
protectedinherited

◆ Dispose()

virtual TTV_ErrorCode ttv::chat::BitsStatus::Dispose ( )
overridevirtual

This should be called when the application is done with the instance.

Implements ttv::chat::IBitsStatus.

◆ FetchBitsConfig()

TTV_ErrorCode ttv::chat::BitsStatus::FetchBitsConfig ( )
private

◆ GetComponentName()

static std::string ttv::chat::BitsStatus::GetComponentName ( )
inlinestatic

◆ GetLoggerName()

virtual std::string ttv::chat::BitsStatus::GetLoggerName ( ) const
overridevirtual

◆ GetState()

virtual State ttv::Component::GetState ( ) const
overridevirtualinherited

Implements ttv::IComponent.

◆ GetTaskRunner()

std::shared_ptr<TaskRunner> ttv::Component::GetTaskRunner ( )
inlineinherited

◆ Initialize()

virtual TTV_ErrorCode ttv::chat::BitsStatus::Initialize ( )
overridevirtual

Reimplemented from ttv::PubSubComponentBase.

◆ IsTaskRunning()

bool ttv::Component::IsTaskRunning ( Task task) const
protectedinherited

◆ Log()

void ttv::UserComponent::Log ( TTV_MessageLevel  level,
const char *  format,
  ... 
)
protectedinherited

◆ OnTopicListenerRemoved()

virtual void ttv::PubSubComponentBase::OnTopicListenerRemoved ( const std::string &  topic,
TTV_ErrorCode  ec 
)
virtualinherited

◆ OnTopicMessageReceived()

void ttv::chat::BitsStatus::OnTopicMessageReceived ( const std::string &  topic,
const json::Value msg 
)
overridevirtual

◆ OnTopicSubscribeStateChanged()

void ttv::chat::BitsStatus::OnTopicSubscribeStateChanged ( const std::string &  topic,
PubSubClient::SubscribeState::Enum  state,
TTV_ErrorCode  ec 
)
overridevirtual

◆ OnUserAuthenticationIssue()

virtual void ttv::UserComponent::OnUserAuthenticationIssue ( std::shared_ptr< const OAuthToken oauthToken,
TTV_ErrorCode  ec 
)
protectedvirtualinherited

◆ OnUserInfoFetchComplete()

virtual void ttv::UserComponent::OnUserInfoFetchComplete ( TTV_ErrorCode  ec)
protectedvirtualinherited

◆ OnUserLogInComplete()

virtual void ttv::UserComponent::OnUserLogInComplete ( TTV_ErrorCode  ec)
protectedvirtualinherited

◆ OnUserLogOutComplete()

virtual void ttv::UserComponent::OnUserLogOutComplete ( TTV_ErrorCode  ec)
protectedvirtualinherited

◆ ParseBitsReceivedMessage()

void ttv::chat::BitsStatus::ParseBitsReceivedMessage ( const ttv::json::Value jBitsMessage,
BitsReceivedEvent event 
)
private

◆ SetBitsConfigRepository()

void ttv::chat::BitsStatus::SetBitsConfigRepository ( const std::shared_ptr< BitsConfigRepository > &  bitsConfigRepository)
inline

◆ SetClientState()

virtual void ttv::Component::SetClientState ( State  state)
protectedvirtualinherited

◆ SetDisposer()

void ttv::PubSubComponentBase::SetDisposer ( DisposerFunc &&  func)
inlineinherited

◆ SetListener()

void ttv::PubSubComponent< IBitsListener >::SetListener ( const std::shared_ptr< IBitsListener > &  listener)
inlineinherited

◆ SetServerState()

virtual void ttv::Component::SetServerState ( State  state)
protectedvirtualinherited

◆ SetState()

virtual void ttv::Component::SetState ( State  state)
protectedvirtualinherited

◆ SetTaskRunner()

virtual void ttv::Component::SetTaskRunner ( std::shared_ptr< TaskRunner taskRunner)
virtualinherited

◆ SetTokenizationOptions()

void ttv::chat::BitsStatus::SetTokenizationOptions ( const TokenizationOptions tokenizationOptions)
inline

◆ Shutdown()

virtual TTV_ErrorCode ttv::chat::BitsStatus::Shutdown ( )
overridevirtual

Reimplemented from ttv::PubSubComponentBase.

◆ StartTask()

TTV_ErrorCode ttv::Component::StartTask ( std::shared_ptr< Task task)
protectedinherited

◆ SubscribeTopics()

virtual TTV_ErrorCode ttv::PubSubComponentBase::SubscribeTopics ( )
protectedvirtualinherited

◆ Update()

virtual void ttv::chat::BitsStatus::Update ( )
overridevirtual

Reimplemented from ttv::Component.

Member Data Documentation

◆ mBitsConfigFetchInFlight

bool ttv::chat::BitsStatus::mBitsConfigFetchInFlight
private

◆ mBitsConfigRepository

std::shared_ptr<BitsConfigRepository> ttv::chat::BitsStatus::mBitsConfigRepository
private

◆ mBitsConfiguration

std::shared_ptr<BitsConfiguration> ttv::chat::BitsStatus::mBitsConfiguration
private

◆ mChannelBitsPubSubTopic

std::string ttv::chat::BitsStatus::mChannelBitsPubSubTopic
private

◆ mChannelId

ChannelId ttv::chat::BitsStatus::mChannelId
private

◆ mDisposerFunc

DisposerFunc ttv::PubSubComponentBase::mDisposerFunc
protectedinherited

◆ mFetchBitsConfigRetryTimer

RetryTimer ttv::chat::BitsStatus::mFetchBitsConfigRetryTimer
private

◆ mHasFetchedBitsConfig

bool ttv::chat::BitsStatus::mHasFetchedBitsConfig
private

◆ mListener

std::shared_ptr<IBitsListener > ttv::PubSubComponent< IBitsListener >::mListener
protectedinherited

◆ mOAuthIssue

bool ttv::UserComponent::mOAuthIssue
protectedinherited

Whether or not the internal updates of the component are on hold because of an issue with the OAuth token.

◆ mPubSub

std::shared_ptr<PubSubClient> ttv::PubSubComponentBase::mPubSub
protectedinherited

◆ mPubSubTopicListener

std::shared_ptr<PubSubTopicListener> ttv::PubSubComponentBase::mPubSubTopicListener
protectedinherited

◆ mPubSubTopicListenerHelper

std::shared_ptr<PubSubTopicListenerHelper> ttv::PubSubComponentBase::mPubSubTopicListenerHelper
protectedinherited

◆ mPubSubTopics

std::vector<std::string> ttv::PubSubComponentBase::mPubSubTopics
protectedinherited

◆ mRunningTasks

std::vector<std::shared_ptr<Task> > ttv::Component::mRunningTasks
protectedinherited

◆ mShutdownTimeMilliseconds

uint64_t ttv::Component::mShutdownTimeMilliseconds
protectedinherited

◆ mState

ClientServerValue<State> ttv::Component::mState
protectedinherited

◆ mTaskMutex

std::mutex ttv::Component::mTaskMutex
mutableprotectedinherited

◆ mTaskRunner

std::shared_ptr<TaskRunner> ttv::Component::mTaskRunner
protectedinherited

◆ mTokenizationOptions

TokenizationOptions ttv::chat::BitsStatus::mTokenizationOptions
private

◆ mUser

std::weak_ptr<User> ttv::UserComponent::mUser
protectedinherited

◆ mUserBitsPubSubTopic

std::string ttv::chat::BitsStatus::mUserBitsPubSubTopic
private

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