blob: e0aa248ad6babfb26fd671f49ad61af0fa475370 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_VOICE_ENGINE_STATISTICS_H
12#define WEBRTC_VOICE_ENGINE_STATISTICS_H
13
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000014#include "webrtc/common_types.h"
Edward Lemurc20978e2017-07-06 19:44:34 +020015#include "webrtc/rtc_base/criticalsection.h"
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000016#include "webrtc/typedefs.h"
17#include "webrtc/voice_engine/include/voe_errors.h"
18#include "webrtc/voice_engine/voice_engine_defines.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000019
20namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000021namespace voe {
22
23class Statistics
24{
25 public:
26 enum {KTraceMaxMessageSize = 256};
27 public:
pbos@webrtc.org92135212013-05-14 08:31:39 +000028 Statistics(uint32_t instanceId);
niklase@google.com470e71d2011-07-07 08:21:25 +000029 ~Statistics();
30
pbos@webrtc.org6141e132013-04-09 10:09:10 +000031 int32_t SetInitialized();
32 int32_t SetUnInitialized();
niklase@google.com470e71d2011-07-07 08:21:25 +000033 bool Initialized() const;
pbos@webrtc.org92135212013-05-14 08:31:39 +000034 int32_t SetLastError(int32_t error) const;
35 int32_t SetLastError(int32_t error, TraceLevel level) const;
36 int32_t SetLastError(int32_t error,
37 TraceLevel level,
pbos@webrtc.org6141e132013-04-09 10:09:10 +000038 const char* msg) const;
39 int32_t LastError() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000040
41 private:
pbosd8de1152016-02-01 09:00:51 -080042 rtc::CriticalSection lock_;
pbos@webrtc.org6141e132013-04-09 10:09:10 +000043 const uint32_t _instanceId;
44 mutable int32_t _lastError;
niklase@google.com470e71d2011-07-07 08:21:25 +000045 bool _isInitialized;
46};
47
48} // namespace voe
49
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000050} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000051
52#endif // WEBRTC_VOICE_ENGINE_STATISTICS_H