2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-06-28 06:34:08 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2012-06-28 06:34:08 +00:00
|
|
|
// TODO(mflodman) Remove this class and use ref count class in system_wrappers.
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-06-29 13:20:14 +00:00
|
|
|
#ifndef WEBRTC_VIDEO_ENGINE_VIE_REF_COUNT_H_
|
|
|
|
|
#define WEBRTC_VIDEO_ENGINE_VIE_REF_COUNT_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-05-17 13:44:48 +00:00
|
|
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
2011-12-22 14:17:53 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
namespace webrtc {
|
2011-11-29 17:31:21 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
class CriticalSectionWrapper;
|
2011-11-29 17:31:21 +00:00
|
|
|
|
|
|
|
|
class ViERefCount {
|
|
|
|
|
public:
|
|
|
|
|
ViERefCount();
|
|
|
|
|
~ViERefCount();
|
|
|
|
|
|
2012-06-28 06:34:08 +00:00
|
|
|
ViERefCount& operator++(int); // NOLINT
|
|
|
|
|
ViERefCount& operator--(int); // NOLINT
|
2011-11-29 17:31:21 +00:00
|
|
|
|
|
|
|
|
void Reset();
|
|
|
|
|
int GetCount() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
volatile int count_;
|
2011-12-22 14:17:53 +00:00
|
|
|
scoped_ptr<CriticalSectionWrapper> crit_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2011-11-29 17:31:21 +00:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2012-06-29 13:20:14 +00:00
|
|
|
#endif // WEBRTC_VIDEO_ENGINE_VIE_REF_COUNT_H_
|