Twitch SDK (Internal)
trackingcontext.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2017 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
12 
13 namespace ttv
14 {
15  class IMutex;
16  class TrackingContext;
17 }
18 
19 
33 {
34 public:
39 
44  TrackingContext(const std::shared_ptr<TrackingContext>& parent);
45 
49  void SetProperty(const std::string& key, const TrackingValue& value);
50 
54  void SetProperties(std::initializer_list<std::pair<std::string, TrackingValue>> properties);
55 
61  TTV_ErrorCode TrackEvent(const std::string& eventName, std::map<std::string, TrackingValue>&& properties);
62 
63 private:
64  std::shared_ptr<ttv::IMutex> mMutex;
65  std::shared_ptr<TrackingContext> mParentContext;
66  std::map<std::string, TrackingValue> mProperties;
67 };
Definition: trackingcontext.h:32
void SetProperties(std::initializer_list< std::pair< std::string, TrackingValue >> properties)
TTV_ErrorCode TrackEvent(const std::string &eventName, std::map< std::string, TrackingValue > &&properties)
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
std::map< std::string, TrackingValue > mProperties
Definition: trackingcontext.h:66
Definition: coretypes.h:211
std::shared_ptr< TrackingContext > mParentContext
Definition: trackingcontext.h:65
void SetProperty(const std::string &key, const TrackingValue &value)
std::shared_ptr< ttv::IMutex > mMutex
Definition: trackingcontext.h:64