diff options
author | Kozoriz <kozorizandriy@gmail.com> | 2016-04-26 12:41:54 +0300 |
---|---|---|
committer | Kozoriz <kozorizandriy@gmail.com> | 2016-04-26 15:50:21 +0300 |
commit | 4ecdb2a83871784f34430ed09d5ef6a2c0855506 (patch) | |
tree | dc36b449e5d32ac3e493e16865cf9d88d9991817 /src/components/utils/include/utils/stl_utils.h | |
parent | cf58bb97d09c536dce3b492d1517da0b837bc8eb (diff) | |
download | sdl_core-4ecdb2a83871784f34430ed09d5ef6a2c0855506.tar.gz |
Format all code in project
Formated all code in appMain, components, plugins to correct coding-style
Used clang-format-3.6
Used 2 commands :
find src/appMain/ -name "*.h" -o -name "*.cc" -o -name "*.hpp" -o -name "*.cpp" | xargs clang-format-3.6 -i -style=file
find src/components/ -name "*.h" -o -name "*.cc" -o -name "*.hpp" -o -name "*.cpp" | xargs clang-format-3.6 -i -style=file
find src/plugins/ -name "*.h" -o -name "*.cc" -o -name "*.hpp" -o -name "*.cpp" | xargs clang-format-3.6 -i -style=file
Diffstat (limited to 'src/components/utils/include/utils/stl_utils.h')
-rw-r--r-- | src/components/utils/include/utils/stl_utils.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/components/utils/include/utils/stl_utils.h b/src/components/utils/include/utils/stl_utils.h index 70fbadbd5e..4a4e3d2fe8 100644 --- a/src/components/utils/include/utils/stl_utils.h +++ b/src/components/utils/include/utils/stl_utils.h @@ -40,45 +40,48 @@ namespace utils { * Utility class that automatically deletes STL collection of * freestore objects */ -template<class T> +template <class T> class StlCollectionDeleter { public: typedef T Collection; - StlCollectionDeleter(T* collection) - : collection_(collection) { + StlCollectionDeleter(T* collection) : collection_(collection) { DCHECK(collection_); } ~StlCollectionDeleter() { - for (typename Collection::iterator i = collection_->begin(), end = - collection_->end(); i != end; ++i) { + for (typename Collection::iterator i = collection_->begin(), + end = collection_->end(); + i != end; + ++i) { delete *i; *i = NULL; } } + private: Collection* collection_; }; -template<class T> +template <class T> class StlMapDeleter { public: typedef T Collection; - StlMapDeleter(T* collection) - : collection_(collection) { + StlMapDeleter(T* collection) : collection_(collection) { DCHECK(collection_); } ~StlMapDeleter() { - for (typename Collection::iterator i = collection_->begin(), end = - collection_->end(); i != end; ++i) { + for (typename Collection::iterator i = collection_->begin(), + end = collection_->end(); + i != end; + ++i) { delete i->second; i->second = NULL; } - } + private: Collection* collection_; }; } // namespace utils -#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_ +#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_STL_UTILS_H_ |