summaryrefslogtreecommitdiff
path: root/src/dpl/core/include/cchecker/dpl/scoped_resource.h
diff options
context:
space:
mode:
authorsangwan.kwon <sangwan.kwon@samsung.com>2016-05-30 14:27:13 +0900
committersangwan.kwon <sangwan.kwon@samsung.com>2016-05-30 14:35:25 +0900
commitb8ffd7662428b4baff92a0c8271e84c2b55ce47b (patch)
treecdeecf4ba84a2fb7c852fa6c538a304f2a458196 /src/dpl/core/include/cchecker/dpl/scoped_resource.h
parent30177b747ab42a7cedc5228803e057d05583b1a6 (diff)
downloadcert-checker-b8ffd7662428b4baff92a0c8271e84c2b55ce47b.tar.gz
cert-checker-b8ffd7662428b4baff92a0c8271e84c2b55ce47b.tar.bz2
cert-checker-b8ffd7662428b4baff92a0c8271e84c2b55ce47b.zip
Apply tizen coding rule
* It depends on cpp rule checker(version 160520) Change-Id: Ica308e1296be4f3567725fdb004f3bae8a456a0c
Diffstat (limited to 'src/dpl/core/include/cchecker/dpl/scoped_resource.h')
-rw-r--r--src/dpl/core/include/cchecker/dpl/scoped_resource.h77
1 files changed, 38 insertions, 39 deletions
diff --git a/src/dpl/core/include/cchecker/dpl/scoped_resource.h b/src/dpl/core/include/cchecker/dpl/scoped_resource.h
index 2b3c72d..42aef36 100644
--- a/src/dpl/core/include/cchecker/dpl/scoped_resource.h
+++ b/src/dpl/core/include/cchecker/dpl/scoped_resource.h
@@ -27,53 +27,52 @@
namespace CCHECKER {
template<typename ClassPolicy>
class ScopedResource :
- private Noncopyable
-{
- public:
- typedef typename ClassPolicy::Type ValueType;
- typedef ScopedResource<ClassPolicy> ThisType;
+ private Noncopyable {
+public:
+ typedef typename ClassPolicy::Type ValueType;
+ typedef ScopedResource<ClassPolicy> ThisType;
- protected:
- ValueType m_value;
+protected:
+ ValueType m_value;
- public:
- explicit ScopedResource(ValueType value) : m_value(value) { }
+public:
+ explicit ScopedResource(ValueType value) : m_value(value) { }
- ~ScopedResource()
- {
- ClassPolicy::Destroy(m_value);
- }
+ ~ScopedResource()
+ {
+ ClassPolicy::Destroy(m_value);
+ }
- ValueType Get() const
- {
- return m_value;
- }
+ ValueType Get() const
+ {
+ return m_value;
+ }
- void Reset(ValueType value = ClassPolicy::NullValue())
- {
- ClassPolicy::Destroy(m_value);
- m_value = value;
- }
+ void Reset(ValueType value = ClassPolicy::NullValue())
+ {
+ ClassPolicy::Destroy(m_value);
+ m_value = value;
+ }
- ValueType Release()
- {
- ValueType value = m_value;
- m_value = ClassPolicy::NullValue();
- return value;
- }
- typedef ValueType ThisType::*UnknownBoolType;
+ ValueType Release()
+ {
+ ValueType value = m_value;
+ m_value = ClassPolicy::NullValue();
+ return value;
+ }
+ typedef ValueType ThisType::*UnknownBoolType;
- operator UnknownBoolType() const
- {
- return m_value == ClassPolicy::NullValue() ?
- 0 : //0 is valid here because it converts to false
- &ThisType::m_value; //it converts to true
- }
+ operator UnknownBoolType() const
+ {
+ return m_value == ClassPolicy::NullValue() ?
+ 0 : //0 is valid here because it converts to false
+ &ThisType::m_value; //it converts to true
+ }
- bool operator !() const
- {
- return m_value == ClassPolicy::NullValue();
- }
+ bool operator !() const
+ {
+ return m_value == ClassPolicy::NullValue();
+ }
};
} // namespace CCHECKER