andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 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.org | 471ae72 | 2013-05-21 13:52:32 +0000 | [diff] [blame] | 14 | #include "webrtc/common_types.h" |
| 15 | #include "webrtc/typedefs.h" |
| 16 | #include "webrtc/voice_engine/include/voe_errors.h" |
| 17 | #include "webrtc/voice_engine/voice_engine_defines.h" |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | class CriticalSectionWrapper; |
| 21 | |
| 22 | namespace voe { |
| 23 | |
| 24 | class Statistics |
| 25 | { |
| 26 | public: |
| 27 | enum {KTraceMaxMessageSize = 256}; |
| 28 | public: |
pbos@webrtc.org | ca7a9a2 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 29 | Statistics(uint32_t instanceId); |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 30 | ~Statistics(); |
| 31 | |
pbos@webrtc.org | 54f03bc | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 32 | int32_t SetInitialized(); |
| 33 | int32_t SetUnInitialized(); |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 34 | bool Initialized() const; |
pbos@webrtc.org | ca7a9a2 | 2013-05-14 08:31:39 +0000 | [diff] [blame] | 35 | 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.org | 54f03bc | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 39 | const char* msg) const; |
| 40 | int32_t LastError() const; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 41 | |
| 42 | private: |
| 43 | CriticalSectionWrapper* _critPtr; |
pbos@webrtc.org | 54f03bc | 2013-04-09 10:09:10 +0000 | [diff] [blame] | 44 | const uint32_t _instanceId; |
| 45 | mutable int32_t _lastError; |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 46 | bool _isInitialized; |
| 47 | }; |
| 48 | |
| 49 | } // namespace voe |
| 50 | |
pbos@webrtc.org | 3b89e10 | 2013-07-03 15:12:26 +0000 | [diff] [blame] | 51 | } // namespace webrtc |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 52 | |
| 53 | #endif // WEBRTC_VOICE_ENGINE_STATISTICS_H |