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/src/HMultiMap.cpp | |
parent | df8ac7c52ff0dfc8e2ba828c4226ed34b0e9ebfc (diff) |
only moving to a new directory
svn path=/trunk/externals/grh/; revision=3740
Diffstat (limited to 'PDContainer/src/HMultiMap.cpp')
-rwxr-xr-x | PDContainer/src/HMultiMap.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/PDContainer/src/HMultiMap.cpp b/PDContainer/src/HMultiMap.cpp new file mode 100755 index 0000000..ecc482e --- /dev/null +++ b/PDContainer/src/HMultiMap.cpp @@ -0,0 +1,38 @@ +// *********************(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.cpp + + +#include "include/HMultiMap.h" + + +//--------------------------------------------------- +/* Get a value from the specific Key with the index number + * index starts with 0 + * returns an element wich points to 0 if nothing was found !!! + */ +Element &HMultiMap::get(Element &key, int index) const +{ + int count = 0; + + for (multimap<Element,Element>::iterator it = data_[h_namespace_].begin(); + it != data_[h_namespace_].end(); ++it) + { + if ((*it).first == key) + { + if(index == count++) + return ((*it).second); + } + } + + // throw an exception if nothing was found + throw "h_multimap, get: Element not found !"; +} |