algorithm.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Utils_algorithm_
18 #define HH_SENF_Utils_algorithm_ 1
19 
20 // Custom includes
21 #include <set>
22 #include <boost/ptr_container/ptr_map.hpp>
23 #include <boost/ptr_container/ptr_unordered_map.hpp>
24 
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 
29  template <typename InputIterator, typename ValueType>
30  bool contains(InputIterator first, InputIterator last, ValueType const & value);
31 
32  template <typename Container, typename ValueType>
33  bool contains(Container const & container, ValueType const & value);
34 
35  template <typename ValueType>
36  bool contains(std::set<ValueType> const & container, ValueType const & value);
37 
38  template <typename KeyType, typename ValueType>
39  bool contains(std::map<KeyType, ValueType> const & container, KeyType const & key);
40 
41  template <typename KeyType, typename ValueType>
42  bool contains(boost::ptr_map<KeyType, ValueType> const & container, KeyType const & key);
43 
44  template <typename KeyType, typename ValueType>
45  bool contains(boost::ptr_unordered_map<KeyType, ValueType> const & container, KeyType const & key);
46 
47  bool contains(std::string const & str, std::string const & substr);
48  bool contains(std::string const & str, char c);
49 
50 }
51 
52 //-/////////////////////////////////////////////////////////////////////////////////////////////////
53 #include "algorithm.cci"
54 //#include "algorithm.ct"
55 #include "algorithm.cti"
56 #endif
57 
58 
59 // Local Variables:
60 // mode: c++
61 // fill-column: 100
62 // comment-column: 40
63 // c-file-style: "senf"
64 // indent-tabs-mode: nil
65 // ispell-local-dictionary: "american"
66 // compile-command: "scons -u test"
67 // End:
std::string str(T const &t)
Get string representation.
bool contains(InputIterator first, InputIterator last, ValueType const &value)