AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder Class Reference

#include <MetricEventBuilder.h>

Public Member Functions

 MetricEventBuilder ()
 
MetricEventBuildersetActivityName (const std::string &activityName)
 
MetricEventBuildersetPriority (Priority priority)
 
MetricEventBuilderaddDataPoint (const DataPoint &dataPoint)
 
MetricEventBuilderaddDataPoints (const std::vector< DataPoint > &dataPoints)
 
MetricEventBuilderremoveDataPoint (const DataPoint &dataPoint)
 
MetricEventBuilderremoveDataPoint (const std::string &name, DataType dataType)
 
MetricEventBuilderremoveDataPoints ()
 
void clear ()
 
std::shared_ptr< MetricEventbuild ()
 

Static Public Member Functions

static std::string generateKey (const std::string &name, DataType dataType)
 

Detailed Description

MetricEventBuilder is a builder class responsible for building immutable MetricEvent objects.

Constructor & Destructor Documentation

◆ MetricEventBuilder()

alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::MetricEventBuilder ( )

Constructor

Member Function Documentation

◆ addDataPoint()

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::addDataPoint ( const DataPoint dataPoint)

Adds a dataPoint object for the current metric event

Parameters
dataPointThe dataPoint object to be added to the current metric event
Returns
This instance to facilitate adding more information to this metric event.

◆ addDataPoints()

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::addDataPoints ( const std::vector< DataPoint > &  dataPoints)

Adds dataPoint objects for the current metric event

Parameters
dataPointsThe shared ptrs to dataPoints to be added to the current metric event
Returns
This instance to facilitate adding more information to this metric event.

◆ build()

std::shared_ptr<MetricEvent> alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::build ( )

Creates a MetricEvent object

Returns
A shared pointer to a MetricEvent object

◆ clear()

void alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::clear ( )

Clears all member variables to the default state

◆ generateKey()

static std::string alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::generateKey ( const std::string &  name,
DataType  dataType 
)
static

Public static method to generate dataPoint key This is needed to provide a consistent way of generating DataPoint objects' keys.

Returns
the key to the dataPoint

◆ removeDataPoint() [1/2]

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::removeDataPoint ( const DataPoint dataPoint)

Removes a dataPoint object from the current metric event

Parameters
dataPointThe dataPoint object to be removed from the current metric event
Returns
This instance to facilitate adding more information to this metric event.

◆ removeDataPoint() [2/2]

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::removeDataPoint ( const std::string &  name,
DataType  dataType 
)

Removes a dataPoint object from the current metric event

Parameters
nameThe name of the dataPoint to be removed from the current metric event
dataTypeThe datatype of the dataPoint to be removed from the current metric event
Returns
This instance to facilitate adding more information to this metric event.

◆ removeDataPoints()

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::removeDataPoints ( )

Removes all dataPoint objects from the current metric event

Returns
This instance to facilitate adding more information to this metric event.

◆ setActivityName()

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::setActivityName ( const std::string &  activityName)

Sets the activity name for the current metric event

Parameters
activityNameThe activity name of the current metric event
Returns
This instance to facilitate adding more information to this metric event.

◆ setPriority()

MetricEventBuilder& alexaClientSDK::avsCommon::utils::metrics::MetricEventBuilder::setPriority ( Priority  priority)

Sets the priority for the current metric event

Parameters
priorityThe priority of current metric event
Returns
This instance to facilitate adding more information to this metric event.

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0