2020-08-14 08:30:45 +03:00
|
|
|
//
|
2021-09-01 01:19:56 +03:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
2020-10-07 10:51:29 +03:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2020-08-14 08:30:45 +03:00
|
|
|
//
|
2019-04-03 00:54:25 +03:00
|
|
|
#ifndef IBANDWIDTHCONTROLLER_HPP
|
|
|
|
#define IBANDWIDTHCONTROLLER_HPP
|
|
|
|
|
2021-02-02 02:26:49 +03:00
|
|
|
#include "ctmacros.hpp"
|
2019-04-03 00:54:25 +03:00
|
|
|
|
2020-08-14 08:30:45 +03:00
|
|
|
namespace MAT_NS_BEGIN
|
2019-04-03 00:54:25 +03:00
|
|
|
{
|
|
|
|
class IBandwidthController {
|
|
|
|
public:
|
|
|
|
virtual ~IBandwidthController() {}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Query the current proposed bandwidth for uploading telemetry events.
|
|
|
|
///
|
|
|
|
/// This method is called each time the SDK is preparing to send some
|
|
|
|
/// events in an HTTP request.
|
|
|
|
///
|
|
|
|
/// The library might not be able to actually honor the return value more
|
|
|
|
/// than just not transmitting anything if the proposed bandwidth is 0 and
|
|
|
|
/// resuming the upload when it isn't.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>Proposed bandwidth in bytes per second</returns>
|
|
|
|
virtual unsigned GetProposedBandwidthBps() = 0;
|
|
|
|
};
|
2020-08-14 08:30:45 +03:00
|
|
|
} MAT_NS_END
|
2019-04-03 00:54:25 +03:00
|
|
|
|
|
|
|
#endif
|
2020-10-07 10:51:29 +03:00
|
|
|
|