diff options
author | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-05-30 14:27:13 +0900 |
---|---|---|
committer | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-05-30 14:35:25 +0900 |
commit | b8ffd7662428b4baff92a0c8271e84c2b55ce47b (patch) | |
tree | cdeecf4ba84a2fb7c852fa6c538a304f2a458196 /src/dpl/core/include/cchecker/dpl/scoped_array.h | |
parent | 30177b747ab42a7cedc5228803e057d05583b1a6 (diff) | |
download | cert-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_array.h')
-rw-r--r-- | src/dpl/core/include/cchecker/dpl/scoped_array.h | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/src/dpl/core/include/cchecker/dpl/scoped_array.h b/src/dpl/core/include/cchecker/dpl/scoped_array.h index 54c0c80..f38ae83 100644 --- a/src/dpl/core/include/cchecker/dpl/scoped_array.h +++ b/src/dpl/core/include/cchecker/dpl/scoped_array.h @@ -29,36 +29,33 @@ namespace CCHECKER { template<typename Class> -struct ScopedArrayPolicy -{ - typedef Class* Type; - static Type NullValue() - { - return NULL; - } - static void Destroy(Type ptr) - { - delete[] ptr; - } +struct ScopedArrayPolicy { + typedef Class *Type; + static Type NullValue() + { + return NULL; + } + static void Destroy(Type ptr) + { + delete[] ptr; + } }; template<typename Class> -class ScopedArray : public ScopedResource<ScopedArrayPolicy<Class> > -{ - typedef ScopedArrayPolicy<Class> Policy; - typedef ScopedResource<Policy> BaseType; - - public: - explicit ScopedArray(Class *ptr = Policy::NullValue()) : BaseType(ptr) { } - - Class &operator [](std::ptrdiff_t k) const - { - Assert(this->m_value != Policy::NullValue() && - "Dereference of scoped NULL array!"); - Assert(k >= 0 && "Negative array index"); - - return this->m_value[k]; - } +class ScopedArray : public ScopedResource<ScopedArrayPolicy<Class>> { + typedef ScopedArrayPolicy<Class> Policy; + typedef ScopedResource<Policy> BaseType; + +public: + explicit ScopedArray(Class *ptr = Policy::NullValue()) : BaseType(ptr) { } + + Class &operator[](std::ptrdiff_t k) const + { + Assert(this->m_value != Policy::NullValue() && + "Dereference of scoped NULL array!"); + Assert(k >= 0 && "Negative array index"); + return this->m_value[k]; + } }; } // namespace CCHECKER |