blob: 369a79a886232b527c5ff8bf89656b9eda2f67fd [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
14#include "common_types.h"
15#include "typedefs.h"
16#include "voice_engine_defines.h"
17#include "voe_errors.h"
18
19namespace webrtc {
20class CriticalSectionWrapper;
21
22namespace voe {
23
24class Statistics
25{
26 public:
27 enum {KTraceMaxMessageSize = 256};
28 public:
pbos@webrtc.org92135212013-05-14 08:31:39 +000029 Statistics(uint32_t instanceId);
niklase@google.com470e71d2011-07-07 08:21:25 +000030 ~Statistics();
31
pbos@webrtc.org6141e132013-04-09 10:09:10 +000032 int32_t SetInitialized();
33 int32_t SetUnInitialized();
niklase@google.com470e71d2011-07-07 08:21:25 +000034 bool Initialized() const;
pbos@webrtc.org92135212013-05-14 08:31:39 +000035 int32_t SetLastError(int32_t error) const;
36 int32_t SetLastError(int32_t error, TraceLevel level) const;
37 int32_t SetLastError(int32_t error,
38 TraceLevel level,
pbos@webrtc.org6141e132013-04-09 10:09:10 +000039 const char* msg) const;
40 int32_t LastError() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000041
42 private:
43 CriticalSectionWrapper* _critPtr;
pbos@webrtc.org6141e132013-04-09 10:09:10 +000044 const uint32_t _instanceId;
45 mutable int32_t _lastError;
niklase@google.com470e71d2011-07-07 08:21:25 +000046 bool _isInitialized;
47};
48
49} // namespace voe
50
51} // namespace webrtc
52
53#endif // WEBRTC_VOICE_ENGINE_STATISTICS_H