diff options
author | Georg Holzmann <grholzi@users.sourceforge.net> | 2005-10-21 11:56:32 +0000 |
---|---|---|
committer | Georg Holzmann <grholzi@users.sourceforge.net> | 2005-10-21 11:56:32 +0000 |
commit | 1d6d1e8c73193f57a9c98387ea42eb91eb4d21d1 (patch) | |
tree | 8d0853fe30b12c73774c786f02f3d3011b147d4c /PDContainer/include/HMultiMap.h | |
parent | df8ac7c52ff0dfc8e2ba828c4226ed34b0e9ebfc (diff) |
only moving to a new directory
svn path=/trunk/externals/grh/; revision=3740
Diffstat (limited to 'PDContainer/include/HMultiMap.h')
-rwxr-xr-x | PDContainer/include/HMultiMap.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/PDContainer/include/HMultiMap.h b/PDContainer/include/HMultiMap.h new file mode 100755 index 0000000..0c7a9f7 --- /dev/null +++ b/PDContainer/include/HMultiMap.h @@ -0,0 +1,80 @@ +// *********************(c)*2004*********************> +// -holzilib--holzilib--holzilib--holzilib--holzilib-> +// ++++PD-External++by+Georg+Holzmann++grh@gmx.at++++> +// +// PDContainer: +// this is a port of the containers from the C++ STL +// (Standard Template Library) +// for usage see the documentation and PD help files +// for license see readme.txt +// +// HMultiMap.h + + +#ifndef _h_multi_map_h__ +#define _h_multi_map_h__ + +#include "include/MapBase.h" + +using std::multimap; + +//--------------------------------------------------- +/* this is the class of the map + */ +class HMultiMap : +public MapBase< multimap<Element,Element>, multimap<Element,Element>::iterator > +{ + + private: + + /* Copy Construction is not allowed + */ + HMultiMap(const HMultiMap &src) + { } + + /* assignement operator is not allowed + */ + const HMultiMap& operator = (const HMultiMap&) + { return *this; } + + public: + + /* Constructor + * no namespace + */ + HMultiMap() + { dataname_ = "h_multimap"; } + + /* Constructor + * with a namespace + */ + HMultiMap(string h_namespace) + { + dataname_ = "h_multimap"; + setNamespace(h_namespace); + } + + /* Destructor + */ + virtual ~HMultiMap() { } + + /* Add a key-value pair + */ + virtual void add(Element key, Element value) + { + this->data_[this->h_namespace_].insert(std::pair<Element,Element>(key,value)); + } + + /* Get the Nr. of values from the specific Key + */ + virtual int getNr(Element &key) const + { return data_[h_namespace_].count(key); } + + /* Get a value from the specific Key with the index number + * index starts with 0 + */ + virtual Element &get(Element &key, int index) const; +}; + + +#endif // _h_multi_map_h__ |