|
Twitch SDK (Internal)
|
#include <trackingcontext.h>
Public Member Functions | |
| TrackingContext () | |
| TrackingContext (const std::shared_ptr< TrackingContext > &parent) | |
| void | SetProperty (const std::string &key, const TrackingValue &value) |
| void | SetProperties (std::initializer_list< std::pair< std::string, TrackingValue >> properties) |
| TTV_ErrorCode | TrackEvent (const std::string &eventName, std::map< std::string, TrackingValue > &&properties) |
Private Attributes | |
| std::shared_ptr< ttv::IMutex > | mMutex |
| std::shared_ptr< TrackingContext > | mParentContext |
| std::map< std::string, TrackingValue > | mProperties |
A class to send tracking events with shared properties.
Shared properties can be set on this class, which will be added to any tracking events sent through this class. Tracking contexts can be a root context, which direcly sends the tracking events, or a child context, which forwards the events to its parent. As such, a child context inherits the shared properties of its parent.
Shared properties in a child context override the values of properties in the parent context with the same key. Similarly, properties directly passed into TrackEvent override any shared properties with the same key.
| ttv::TrackingContext::TrackingContext | ( | ) |
Create a root tracking context that directly sends tracking events.
| ttv::TrackingContext::TrackingContext | ( | const std::shared_ptr< TrackingContext > & | parent | ) |
Create a child tracking context, which sends events to its parent.
| [in] | parent | The parent tracking context. |
| void ttv::TrackingContext::SetProperties | ( | std::initializer_list< std::pair< std::string, TrackingValue >> | properties | ) |
Sets multiple properties on the context. These are guaranteed to be atomically set.
| void ttv::TrackingContext::SetProperty | ( | const std::string & | key, |
| const TrackingValue & | value | ||
| ) |
Sets a property on the context.
| TTV_ErrorCode ttv::TrackingContext::TrackEvent | ( | const std::string & | eventName, |
| std::map< std::string, TrackingValue > && | properties | ||
| ) |
Track an event.
| [in] | eventName | The name of the event to be tracked. |
| [in] | properties | A map of properties to send with the event. |
|
private |
|
private |
|
private |
1.8.13