niklase@google.com | 470e71d | 2011-07-07 08:21:25 +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 | |
| 14 | #include "common_types.h" |
| 15 | #include "typedefs.h" |
| 16 | #include "voice_engine_defines.h" |
| 17 | #include "voe_errors.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | class CriticalSectionWrapper; |
| 21 | |
| 22 | namespace voe { |
| 23 | |
| 24 | class Statistics |
| 25 | { |
| 26 | public: |
| 27 | enum {KTraceMaxMessageSize = 256}; |
| 28 | public: |
| 29 | Statistics(const WebRtc_UWord32 instanceId); |
| 30 | ~Statistics(); |
| 31 | |
| 32 | WebRtc_Word32 SetInitialized(); |
| 33 | WebRtc_Word32 SetUnInitialized(); |
| 34 | bool Initialized() const; |
| 35 | WebRtc_Word32 SetLastError(const WebRtc_Word32 error) const; |
| 36 | WebRtc_Word32 SetLastError(const WebRtc_Word32 error, |
| 37 | const TraceLevel level) const; |
| 38 | WebRtc_Word32 SetLastError(const WebRtc_Word32 error, |
| 39 | const TraceLevel level, |
| 40 | const char* msg) const; |
| 41 | WebRtc_Word32 LastError() const; |
| 42 | |
| 43 | private: |
| 44 | CriticalSectionWrapper* _critPtr; |
| 45 | const WebRtc_UWord32 _instanceId; |
| 46 | mutable WebRtc_Word32 _lastError; |
| 47 | bool _isInitialized; |
| 48 | }; |
| 49 | |
| 50 | } // namespace voe |
| 51 | |
| 52 | } // namespace webrtc |
| 53 | |
| 54 | #endif // WEBRTC_VOICE_ENGINE_STATISTICS_H |