diff --git a/src/functions.h b/src/functions.h index 3733ad1..ab0086b 100755 --- a/src/functions.h +++ b/src/functions.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2007-2011, Tomasz Sowa + * Copyright (c) 2007-2012, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -66,6 +66,8 @@ public: std::wstring variable; // used when type is 'variable' }; + typedef std::map FunctionsTable; + typedef typename FunctionsTable::iterator Iterator; void Insert(const char * key, UserFunction ufunction); // inserting a function @@ -78,14 +80,15 @@ public: void Insert(const std::wstring & key, const wchar_t * var); void Insert(const std::wstring & key, const std::wstring & var); - bool Find(const std::string & key, Function ** fun); bool Find(const std::wstring & key, Function ** fun); - void Clear(); + + Iterator Begin(); + Iterator End(); size_t Size() const; + void Clear(); private: - typedef std::map FunctionsTable; FunctionsTable functions_tab; std::wstring temp_key; }; @@ -234,6 +237,19 @@ void Functions::Clear() } +template +typename Functions::Iterator Functions::Begin() +{ + return functions_tab.begin(); +} + + +template +typename Functions::Iterator Functions::End() +{ + return functions_tab.end(); +} + template size_t Functions::Size() const