This file contains several utility functions for dealing with STL containers. More...
#include <algorithm>#include <ctime>#include <list>#include <map>#include <set>#include <string>#include <vector>Go to the source code of this file.
Namespaces | |
| namespace | te |
| TerraLib. | |
| namespace | te::common |
| Namespace for the Common module of TerraLib. | |
Functions | |
| template<class T , class T1 > | |
| void | te::common::Clone (const std::vector< T * > &src, std::vector< T1 * > &dst) |
| This function can be applied to a vector of pointers. | |
| template<class T > | |
| bool | te::common::Contains (const std::vector< T > &src, const T &value) |
| template<class T > | |
| void | te::common::Copy (const std::vector< T * > &src, std::vector< T * > &dst) |
| This function can be applied to a vector of pointers. It will copy element by element through its copy constructor supposing a vector of pointers. | |
| void | te::common::Free (char **carray) |
| It releases the char array. | |
| template<class T > | |
| void | te::common::Free (std::vector< T * > *v) |
| This function can be applied to a pointer to a vector of pointers. | |
| template<class T > | |
| void | te::common::Free (T **a, std::size_t s) |
| It releases the given array. | |
| template<class T > | |
| void | te::common::FreeContents (const std::vector< T * > &v) |
| This function can be applied to a vector of pointers. It will delete each pointer in the vector. | |
| template<class IT > | |
| void | te::common::FreeContents (IT it, IT itend) |
| This function can be applied to a vector of pointers. It will delete each pointer in the vector. | |
| template<class T > | |
| void | te::common::FreeContents (std::list< T * > &l) |
| This function can be applied to a list of pointers. It will delete each pointer in the vector. | |
| template<class K , class V > | |
| void | te::common::FreeContents (std::map< K, V * > &m) |
| This function can be applied to a map of pointers. It will delete each pointer in the map. | |
| template<class V , class C > | |
| void | te::common::FreeContents (std::set< V *, C > &m) |
| This function can be applied to a map of pointers. It will delete each pointer in the map. | |
| std::string | te::common::GetCurrentTime (const std::string &format="%d.%m.%Y %H:%M:%S") |
| template<class K , class V > | |
| V ** | te::common::GetPPValue (std::map< K, V * > &m, const K &k) |
| It finds for a given key in the map and returns a pointer if something is found or NULL otherwise. | |
| template<class K , class V > | |
| V * | te::common::GetPValue (const std::map< K, V * > &m, const K &k) |
| It finds for a given key in the map and returns a pointer if something is found or NULL otherwise. | |
| template<class K , class C > | |
| K * | te::common::GetPValue (const std::set< K *, C > &m, K *k) |
| It finds for a given key in the map and returns a pointer if something is found or NULL otherwise. | |
This file contains several utility functions for dealing with STL containers.
Definition in file STLUtils.h.