Chemical Data Processing Library C++ API - Version 1.4.0
Map.hpp
Go to the documentation of this file.
1 /*
2  * Map.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_UTIL_MAP_HPP
30 #define CDPL_UTIL_MAP_HPP
31 
32 #include <map>
33 #include <functional>
34 #include <utility>
35 #include <string>
36 #include <cstddef>
37 #include <memory>
38 
39 #include "CDPL/Base/Exceptions.hpp"
40 
41 
42 namespace CDPL
43 {
44 
45  namespace Util
46  {
47 
53  template <typename ValueType, bool Allow = true>
55  {
56 
61  static const ValueType& get()
62  {
63  return defValue;
64  }
65 
69  static const ValueType defValue;
70  };
71 
72  template <typename ValueType, bool Allow>
73  const ValueType MapDefaultValue<ValueType, Allow>::defValue = ValueType();
74 
79  template <typename ValueType>
80  struct MapDefaultValue<ValueType, false>
81  {
82 
88  static const ValueType& get()
89  {
90  throw Base::OperationFailed("Map: default value not supported");
91  }
92  };
93 
114  template <typename Key, typename Value, bool AllowDefValues = false,
115  typename KeyCompFunc = std::less<Key> >
116  class Map
117  {
118 
119  typedef std::map<Key, Value, KeyCompFunc> StorageType;
120 
121  public:
125  typedef std::shared_ptr<Map> SharedPointer;
126 
130  typedef Key KeyType;
131 
135  typedef Value ValueType;
136 
143  typedef typename StorageType::value_type Entry;
144 
148  typedef typename StorageType::const_iterator ConstEntryIterator;
149 
153  typedef typename StorageType::const_reverse_iterator ConstReverseEntryIterator;
154 
158  typedef typename StorageType::iterator EntryIterator;
159 
163  typedef typename StorageType::reverse_iterator ReverseEntryIterator;
164 
168  Map():
169  data() {}
170 
175  Map(const KeyCompFunc& func):
176  data(func) {}
177 
183  template <typename InputIter>
184  Map(const InputIter& first, const InputIter& last):
185  data(first, last)
186  {}
187 
195  template <typename InputIter>
196  Map(const InputIter& first, const InputIter& last, const KeyCompFunc& func):
197  data(first, last, func)
198  {}
199 
203  virtual ~Map() {}
204 
209  StorageType& getData();
210 
215  const StorageType& getData() const;
216 
221  std::size_t getSize() const;
222 
227  bool isEmpty() const;
228 
232  void clear();
233 
238  void swap(Map& map);
239 
244  KeyCompFunc getKeyCompareFunction() const;
245 
256  EntryIterator getEntry(const Key& key);
257 
268  ConstEntryIterator getEntry(const Key& key) const;
269 
275  bool containsEntry(const Key& key) const;
276 
291  Value& getValue(const Key& key);
292 
307  Value& getValue(const Key& key, Value& def_value);
308 
323  const Value& getValue(const Key& key) const;
324 
339  const Value& getValue(const Key& key, const Value& def_value) const;
340 
352  Value& operator[](const Key& key);
353 
365  const Value& operator[](const Key& key) const;
366 
371  void removeEntry(const EntryIterator& it);
372 
377  bool removeEntry(const Key& key);
378 
384  void removeEntries(const EntryIterator& first, const EntryIterator& last);
385 
401  std::pair<EntryIterator, bool> insertEntry(const Entry& item);
402 
419  std::pair<EntryIterator, bool> insertEntry(const Key& key, const Value& value);
420 
434  EntryIterator insertEntry(const EntryIterator& it, const Entry& item);
435 
450  EntryIterator insertEntry(const EntryIterator& it, const Key& key, const Value& value);
451 
465 
479  EntryIterator setEntry(const Key& key, const Value& value);
480 
491  template <typename InputIter>
492  void insertEntries(const InputIter& first, const InputIter& last);
493 
504  template <typename InputIter>
505  void setEntries(const InputIter& first, const InputIter& last);
506 
512  EntryIterator getLowerBound(const Key& key);
513 
519  ConstEntryIterator getLowerBound(const Key& key) const;
520 
526  EntryIterator getUpperBound(const Key& key);
527 
533  ConstEntryIterator getUpperBound(const Key& key) const;
534 
540 
546 
552 
558 
564 
570 
576 
582 
588 
594 
600 
606 
607 
608  protected:
636  virtual const char* getClassName() const;
637 
638  private:
639  const Value& getDefaultValue() const;
640 
641  StorageType data;
642  };
643 
652  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
655 
664  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
667 
676  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
679 
688  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
691 
700  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
703 
712  template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
715 
716  } // namespace Util
717 } // namespace CDPL
718 
719 
720 // Implementation
721 
722 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
723 typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::StorageType&
725 {
726  return data;
727 }
728 
729 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
730 const typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::StorageType&
732 {
733  return data;
734 }
735 
736 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
738 {
739  return data.size();
740 }
741 
742 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
744 {
745  return data.empty();
746 }
747 
748 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
750 {
751  data.clear();
752 }
753 
754 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
756 {
757  data.swap(map.data);
758 }
759 
760 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
762 {
763  return data.key_comp();
764 }
765 
766 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
769 {
770  return data.find(key);
771 }
772 
773 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
776 {
777  return data.find(key);
778 }
779 
780 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
782 {
783  return (data.find(key) != data.end());
784 }
785 
786 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
788 {
789  EntryIterator lb = data.lower_bound(key);
790 
791  if (lb == data.end() || data.key_comp()(key, (*lb).first)) {
792  if (!AllowDefValues)
793  throw Base::ItemNotFound(std::string(getClassName()) + ": key not found");
794 
795  return (*data.insert(lb, Entry(key, getDefaultValue()))).second;
796  }
797 
798  return (*lb).second;
799 }
800 
801 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
803 {
804  EntryIterator it = data.find(key);
805 
806  if (it == data.end())
807  return def_value;
808 
809  return (*it).second;
810 }
811 
812 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
814 {
815  ConstEntryIterator it = data.find(key);
816 
817  if (it == data.end()) {
818  if (!AllowDefValues)
819  throw Base::ItemNotFound(std::string(getClassName()) + ": key not found");
820 
821  return getDefaultValue();
822  }
823 
824  return (*it).second;
825 }
826 
827 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
829  const Value& def_value) const
830 {
831  ConstEntryIterator it = data.find(key);
832 
833  if (it == data.end())
834  return def_value;
835 
836  return (*it).second;
837 }
838 
839 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
841 {
842  return getValue(key);
843 }
844 
845 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
847 {
848  return getValue(key);
849 }
850 
851 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
853 {
854  data.erase(it);
855 }
856 
857 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
859 {
860  return (data.erase(key) > 0);
861 }
862 
863 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
865  const EntryIterator& last)
866 {
867  data.erase(first, last);
868 }
869 
870 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
871 std::pair<typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::EntryIterator, bool>
873 {
874  return data.insert(item);
875 }
876 
877 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
878 std::pair<typename CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::EntryIterator, bool>
880 {
881  return data.insert(Entry(key, value));
882 }
883 
884 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
887 {
888  return data.insert(it, item);
889 }
890 
891 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
894  const Value& value)
895 {
896  return data.insert(it, Entry(key, value));
897 }
898 
899 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
902 {
903  EntryIterator lb = data.lower_bound(item.first);
904 
905  if (lb == data.end() || data.key_comp()(item.first, (*lb).first))
906  return data.insert(lb, item);
907 
908  (*lb).second = item.second;
909  return lb;
910 }
911 
912 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
915 {
916  return setEntry(Entry(key, value));
917 }
918 
919 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
920 template <typename InputIter>
921 void CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::insertEntries(const InputIter& first, const InputIter& last)
922 {
923  data.insert(first, last);
924 }
925 
926 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
927 template <typename InputIter>
928 void CDPL::Util::Map<Key, Value, AllowDefValues, KeyCompFunc>::setEntries(const InputIter& first, const InputIter& last)
929 {
930  for (InputIter it = first; it != last; ++it)
931  setEntry(*it);
932 }
933 
934 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
937 {
938  return data.lower_bound(key);
939 }
940 
941 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
944 {
945  return data.lower_bound(key);
946 }
947 
948 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
951 {
952  return data.upper_bound(key);
953 }
954 
955 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
958 {
959  return data.upper_bound(key);
960 }
961 
962 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
965 {
966  return data.begin();
967 }
968 
969 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
972 {
973  return data.begin();
974 }
975 
976 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
979 {
980  return data.end();
981 }
982 
983 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
986 {
987  return data.end();
988 }
989 
990 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
993 {
994  return data.begin();
995 }
996 
997 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1000 {
1001  return data.begin();
1002 }
1003 
1004 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1007 {
1008  return data.end();
1009 }
1010 
1011 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1014 {
1015  return data.end();
1016 }
1017 
1018 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1021 {
1022  return data.rbegin();
1023 }
1024 
1025 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1028 {
1029  return data.rbegin();
1030 }
1031 
1032 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1035 {
1036  return data.rend();
1037 }
1038 
1039 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1042 {
1043  return data.rend();
1044 }
1045 
1046 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1048 {
1049  return "Map";
1050 }
1051 
1052 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1054 {
1056 }
1057 
1058 // \cond DOC_IMPL_DETAILS
1059 
1060 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1061 bool CDPL::Util::operator==(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1062  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1063 {
1064  return (map1.getData() == map2.getData());
1065 }
1066 
1067 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1068 bool CDPL::Util::operator!=(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1069  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1070 {
1071  return (map1.getData() != map2.getData());
1072 }
1073 
1074 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1075 bool CDPL::Util::operator<=(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1076  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1077 {
1078  return (map1.getData() <= map2.getData());
1079 }
1080 
1081 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1082 bool CDPL::Util::operator>=(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1083  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1084 {
1085  return (map1.getData() >= map2.getData());
1086 }
1087 
1088 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1089 bool CDPL::Util::operator<(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1090  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1091 {
1092  return (map1.getData() < map2.getData());
1093 }
1094 
1095 template <typename Key, typename Value, bool AllowDefValues, typename KeyCompFunc>
1096 bool CDPL::Util::operator>(const Map<Key, Value, AllowDefValues, KeyCompFunc>& map1,
1097  const Map<Key, Value, AllowDefValues, KeyCompFunc>& map2)
1098 {
1099  return (map1.getData() > map2.getData());
1100 }
1101 
1102 // \endcond
1103 
1104 #endif // CDPL_UTIL_MAP_HPP
Definition of exception classes.
Thrown to indicate that some requested data item could not be found.
Definition: Base/Exceptions.hpp:171
Thrown to indicate that some requested operation has failed (e.g. due to unfulfilled preconditions or...
Definition: Base/Exceptions.hpp:211
A unique sorted associative container that maps keys to values.
Definition: Map.hpp:117
EntryIterator setEntry(const Key &key, const Value &value)
Inserts a new entry or updates the value of an existing entry with the specified key and value.
Definition: Map.hpp:914
const Value & operator[](const Key &key) const
Returns a const reference to the value associated with the specified key.
Definition: Map.hpp:846
EntryIterator getLowerBound(const Key &key)
Returns a mutable iterator pointing to the first entry whose key is not less than key.
Definition: Map.hpp:936
std::pair< EntryIterator, bool > insertEntry(const Entry &item)
Tries to insert the key/value pair item into the map.
Definition: Map.hpp:872
std::pair< EntryIterator, bool > insertEntry(const Key &key, const Value &value)
Tries to insert a new entry with specified key and value into the map.
Definition: Map.hpp:879
KeyCompFunc getKeyCompareFunction() const
Returns the key compare function used by the map.
Definition: Map.hpp:761
virtual const char * getClassName() const
Returns the name of the (derived) Map class.
Definition: Map.hpp:1047
EntryIterator insertEntry(const EntryIterator &it, const Key &key, const Value &value)
Tries to insert a new entry with the specified key and value into the map and uses the iterator it as...
Definition: Map.hpp:893
EntryIterator insertEntry(const EntryIterator &it, const Entry &item)
Tries to insert the key/value pair item into the map and uses the iterator it as a hint for the inser...
Definition: Map.hpp:886
EntryIterator getEntriesBegin()
Returns a mutable iterator pointing to the beginning of the map.
Definition: Map.hpp:971
std::size_t getSize() const
Returns the size (number of entries) of the map.
Definition: Map.hpp:737
void removeEntry(const EntryIterator &it)
Removes the entry pointed to by the iterator it from the map.
Definition: Map.hpp:852
Value & getValue(const Key &key)
Returns a non-const reference to the value associated with the specified key.
Definition: Map.hpp:787
Map(const InputIter &first, const InputIter &last)
Creates and initializes the map with copies of the key value pairs in the range [first,...
Definition: Map.hpp:184
ConstEntryIterator getEntriesBegin() const
Returns a constant iterator pointing to the beginning of the map.
Definition: Map.hpp:964
StorageType & getData()
Returns a non-const reference to the underlying map storage.
Definition: Map.hpp:724
bool isEmpty() const
Tells whether the map is empty (getSize() == 0).
Definition: Map.hpp:743
EntryIterator getUpperBound(const Key &key)
Returns a mutable iterator pointing to the first entry whose key is greater than key.
Definition: Map.hpp:950
void insertEntries(const InputIter &first, const InputIter &last)
Tries to insert the key/value pairs in the range [first, last).
Definition: Map.hpp:921
Map(const InputIter &first, const InputIter &last, const KeyCompFunc &func)
Creates and initializes the map with copies of the key value pairs in the range [first,...
Definition: Map.hpp:196
StorageType::const_reverse_iterator ConstReverseEntryIterator
A constant iterator used to iterate backwards over the entries of the map.
Definition: Map.hpp:153
ReverseEntryIterator getEntriesReverseBegin()
Returns a mutable iterator pointing to the beginning of the reversed map.
Definition: Map.hpp:1027
ConstEntryIterator getLowerBound(const Key &key) const
Returns a constant iterator pointing to the first entry whose key is not less than key.
Definition: Map.hpp:943
StorageType::const_iterator ConstEntryIterator
A constant iterator used to iterate over the entries of the map.
Definition: Map.hpp:148
EntryIterator getEntriesEnd()
Returns a mutable iterator pointing to the end of the map.
Definition: Map.hpp:985
void swap(Map &map)
Swaps the contents with map.
Definition: Map.hpp:755
bool removeEntry(const Key &key)
Removes the entry specified by key from the map.
Definition: Map.hpp:858
ConstEntryIterator end() const
Returns a constant iterator pointing to the end of the map.
Definition: Map.hpp:1006
EntryIterator getEntry(const Key &key)
Returns a mutable iterator pointing to the entry specified by key.
Definition: Map.hpp:768
ReverseEntryIterator getEntriesReverseEnd()
Returns a mutable iterator pointing to the end of the reversed map.
Definition: Map.hpp:1041
const StorageType & getData() const
Returns a const reference to the underlying map storage.
Definition: Map.hpp:731
Value & getValue(const Key &key, Value &def_value)
Returns a non-const reference to the value associated with the specified key, or the value given by t...
Definition: Map.hpp:802
const Value & getValue(const Key &key) const
Returns a const reference to the value associated with the specified key.
Definition: Map.hpp:813
Map()
Creates an empty map.
Definition: Map.hpp:168
bool containsEntry(const Key &key) const
Tells whether the map contains an entry with the specified key.
Definition: Map.hpp:781
StorageType::reverse_iterator ReverseEntryIterator
A mutable iterator used to iterate backwards over the entries of the map.
Definition: Map.hpp:163
Map(const KeyCompFunc &func)
Creates an empty map and uses func as key compare function.
Definition: Map.hpp:175
EntryIterator end()
Returns a mutable iterator pointing to the end of the map.
Definition: Map.hpp:1013
void clear()
Erases all entries.
Definition: Map.hpp:749
ConstReverseEntryIterator getEntriesReverseBegin() const
Returns a constant iterator pointing to the beginning of the reversed map.
Definition: Map.hpp:1020
Value & operator[](const Key &key)
Returns a non-const reference to the value associated with the specified key.
Definition: Map.hpp:840
StorageType::iterator EntryIterator
A mutable iterator used to iterate over the entries of the map.
Definition: Map.hpp:158
ConstEntryIterator begin() const
Returns a constant iterator pointing to the beginning of the map.
Definition: Map.hpp:992
ConstEntryIterator getUpperBound(const Key &key) const
Returns a constant iterator pointing to the first entry whose key is greater than key.
Definition: Map.hpp:957
EntryIterator setEntry(const Entry &item)
Inserts a new entry or updates the value of an existing entry with the key and value given by item.
Definition: Map.hpp:901
const Value & getValue(const Key &key, const Value &def_value) const
Returns a const reference to the value associated with the specified key, or the value given by the s...
Definition: Map.hpp:828
ConstEntryIterator getEntriesEnd() const
Returns a constant iterator pointing to the end of the map.
Definition: Map.hpp:978
ConstReverseEntryIterator getEntriesReverseEnd() const
Returns a constant iterator pointing to the end of the reversed map.
Definition: Map.hpp:1034
std::shared_ptr< Map > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Map instances.
Definition: Map.hpp:125
virtual ~Map()
Virtual destructor.
Definition: Map.hpp:203
Key KeyType
The type of the map's keys.
Definition: Map.hpp:130
void removeEntries(const EntryIterator &first, const EntryIterator &last)
Removes all entries pointed to by the iterators in the range [first, last) from the map.
Definition: Map.hpp:864
void setEntries(const InputIter &first, const InputIter &last)
Inserts new entries or updates the value of existing entries using the key/value pairs in the range [...
Definition: Map.hpp:928
Value ValueType
The type of the mapped values.
Definition: Map.hpp:135
EntryIterator begin()
Returns a mutable iterator pointing to the beginning of the map.
Definition: Map.hpp:999
StorageType::value_type Entry
The type of the key/value pairs stored in the map.
Definition: Map.hpp:143
ConstEntryIterator getEntry(const Key &key) const
Returns a constant iterator pointing to the entry specified by key.
Definition: Map.hpp:775
bool operator<(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less than comparison operator.
bool operator>=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater or equal comparison operator.
bool operator>(const Array< ValueType > &array1, const Array< ValueType > &array2)
Greater than comparison operator.
bool operator!=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Inequality comparison operator.
bool operator<=(const Array< ValueType > &array1, const Array< ValueType > &array2)
Less or equal comparison operator.
bool operator==(const Array< ValueType > &array1, const Array< ValueType > &array2)
Equality comparison operator.
The namespace of the Chemical Data Processing Library.
static const ValueType & get()
Always throws, since default values are not supported for this map configuration.
Definition: Map.hpp:88
Helper supplying the default value returned by Util::Map when a queried key is absent.
Definition: Map.hpp:55
static const ValueType defValue
The default-constructed value returned for an absent key.
Definition: Map.hpp:69
static const ValueType & get()
Returns a const reference to the shared default-constructed value.
Definition: Map.hpp:61