GOG GALAXY SDK Documentation
ITelemetry.h
Go to the documentation of this file.
1 #ifndef GALAXY_I_TELEMETRY_H
2 #define GALAXY_I_TELEMETRY_H
3 
9 #include "IListenerRegistrar.h"
10 
11 namespace galaxy
12 {
13  namespace api
14  {
23  class ITelemetryEventSendListener : public GalaxyTypeAwareListener<TELEMETRY_EVENT_SEND_LISTENER>
24  {
25  public:
26 
33  virtual void OnTelemetryEventSendSuccess(const char* eventType, uint32_t sentEventIndex) = 0;
34 
39  {
49  };
50 
58  virtual void OnTelemetryEventSendFailure(const char* eventType, uint32_t sentEventIndex, FailureReason failureReason) = 0;
59  };
60 
65 
66 
71 
75  class ITelemetry
76  {
77  public:
78 
79  virtual ~ITelemetry()
80  {
81  }
82 
94  virtual void AddStringParam(const char* name, const char* value) = 0;
95 
107  virtual void AddIntParam(const char* name, int32_t value) = 0;
108 
120  virtual void AddFloatParam(const char* name, double value) = 0;
121 
133  virtual void AddBoolParam(const char* name, bool value) = 0;
134 
149  virtual void AddObjectParam(const char* name) = 0;
150 
165  virtual void AddArrayParam(const char* name) = 0;
166 
176  virtual void CloseParam() = 0;
177 
183  virtual void ClearParams() = 0;
184 
185 
192  virtual void SetSamplingClass(const char* name) = 0;
193 
209  virtual uint32_t SendTelemetryEvent(const char* eventType, ITelemetryEventSendListener* const listener = NULL) = 0;
210 
226  virtual uint32_t SendAnonymousTelemetryEvent(const char* eventType, ITelemetryEventSendListener* const listener = NULL) = 0;
227 
235  virtual const char* GetVisitID() = 0;
236 
245  virtual void GetVisitIDCopy(char* buffer, uint32_t bufferLength) = 0;
246 
252  virtual void ResetVisitID() = 0;
253  };
254 
256  }
257 }
258 
259 #endif
Contains data structures and interfaces related to callback listeners.
The class that is inherited by all specific callback listeners and provides a static method that retu...
Definition: IListenerRegistrar.h:117
Listener for the event of sending a telemetry event.
Definition: ITelemetry.h:24
virtual void OnTelemetryEventSendSuccess(const char *eventType, uint32_t sentEventIndex)=0
Notification for the event of sending a telemetry event.
FailureReason
The reason of a failure in sending a telemetry event.
Definition: ITelemetry.h:39
@ FAILURE_REASON_EVENT_SAMPLED_OUT
The event did not match sampling criteria.
Definition: ITelemetry.h:46
@ FAILURE_REASON_CLIENT_FORBIDDEN
Sending telemetry events is forbidden for this application.
Definition: ITelemetry.h:41
@ FAILURE_REASON_NO_SAMPLING_CLASS_IN_CONFIG
The event sampling class not present in configuration.
Definition: ITelemetry.h:44
@ FAILURE_REASON_UNDEFINED
Unspecified error.
Definition: ITelemetry.h:40
@ FAILURE_REASON_SAMPLING_RESULT_ALREADY_EXIST
The event already contains a field defined as "dry_run_result_path".
Definition: ITelemetry.h:47
@ FAILURE_REASON_INVALID_DATA
The event of given type and form does not match specification.
Definition: ITelemetry.h:42
@ FAILURE_REASON_CONNECTION_FAILURE
Unable to communicate with backend services.
Definition: ITelemetry.h:43
@ FAILURE_REASON_SAMPLING_CLASS_FIELD_MISSING
Sampling class' field not present in the event.
Definition: ITelemetry.h:45
@ FAILURE_REASON_SAMPLING_INVALID_RESULT_PATH
"dry_run_result_path" has an invalid value (doesn't start with "data" or "meta" or one of the interme...
Definition: ITelemetry.h:48
virtual void OnTelemetryEventSendFailure(const char *eventType, uint32_t sentEventIndex, FailureReason failureReason)=0
Notification for the event of a failure in sending a telemetry event.
The interface for handling telemetry.
Definition: ITelemetry.h:76
virtual void AddArrayParam(const char *name)=0
Adds an array parameter to be applied next time you call SendTelemetryEvent() or SendAnonymousTelemet...
virtual void CloseParam()=0
Closes an object or array parameter and leaves its scope.
virtual const char * GetVisitID()=0
Retrieves current VisitID.
virtual void ResetVisitID()=0
Resets current VisitID.
virtual void SetSamplingClass(const char *name)=0
Sets a sampling class to be applied next time you call SendTelemetryEvent() or SendAnonymousTelemetry...
virtual void AddObjectParam(const char *name)=0
Adds an object parameter to be applied next time you call SendTelemetryEvent() or SendAnonymousTeleme...
virtual void AddBoolParam(const char *name, bool value)=0
Adds a boolean parameter to be applied next time you call SendTelemetryEvent() or SendAnonymousTeleme...
virtual void AddFloatParam(const char *name, double value)=0
Adds a float parameter to be applied next time you call SendTelemetryEvent() or SendAnonymousTelemetr...
virtual uint32_t SendTelemetryEvent(const char *eventType, ITelemetryEventSendListener *const listener=NULL)=0
Sends a telemetry event.
virtual void AddIntParam(const char *name, int32_t value)=0
Adds an integer parameter to be applied next time you call SendTelemetryEvent() or SendAnonymousTelem...
virtual void AddStringParam(const char *name, const char *value)=0
Adds a string parameter to be applied next time you call SendTelemetryEvent() or SendAnonymousTelemet...
virtual uint32_t SendAnonymousTelemetryEvent(const char *eventType, ITelemetryEventSendListener *const listener=NULL)=0
Sends an anonymous telemetry event.
virtual void ClearParams()=0
Clears all parameters that may have been set so far at any level.
virtual void GetVisitIDCopy(char *buffer, uint32_t bufferLength)=0
Copies current VisitID.
The class that is inherited by the self-registering versions of all specific callback listeners.
Definition: IListenerRegistrar.h:211
SelfRegisteringListener< ITelemetryEventSendListener, GameServerListenerRegistrar > GameServerGlobalTelemetryEventSendListener
Globally self-registering version of ITelemetryEventSendListener for the Game Server.
Definition: ITelemetry.h:70
SelfRegisteringListener< ITelemetryEventSendListener > GlobalTelemetryEventSendListener
Globally self-registering version of ITelemetryEventSendListener.
Definition: ITelemetry.h:64