added: methods Begin() and End() to Functions<>
we can iterate through the whole functions table git-svn-id: svn://ttmath.org/publicrep/ezc/trunk@360 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
b4f7d4b8de
commit
c6b4db0aa9
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007-2011, Tomasz Sowa
|
* Copyright (c) 2007-2012, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -66,6 +66,8 @@ public:
|
||||||
std::wstring variable; // used when type is 'variable'
|
std::wstring variable; // used when type is 'variable'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::map<std::wstring, Function> FunctionsTable;
|
||||||
|
typedef typename FunctionsTable::iterator Iterator;
|
||||||
|
|
||||||
|
|
||||||
void Insert(const char * key, UserFunction ufunction); // inserting a function
|
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 wchar_t * var);
|
||||||
void Insert(const std::wstring & key, const std::wstring & var);
|
void Insert(const std::wstring & key, const std::wstring & var);
|
||||||
|
|
||||||
|
|
||||||
bool Find(const std::string & key, Function ** fun);
|
bool Find(const std::string & key, Function ** fun);
|
||||||
bool Find(const std::wstring & key, Function ** fun);
|
bool Find(const std::wstring & key, Function ** fun);
|
||||||
void Clear();
|
|
||||||
|
Iterator Begin();
|
||||||
|
Iterator End();
|
||||||
size_t Size() const;
|
size_t Size() const;
|
||||||
|
void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<std::wstring, Function> FunctionsTable;
|
|
||||||
FunctionsTable functions_tab;
|
FunctionsTable functions_tab;
|
||||||
std::wstring temp_key;
|
std::wstring temp_key;
|
||||||
};
|
};
|
||||||
|
@ -234,6 +237,19 @@ void Functions<StreamType>::Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StreamType>
|
||||||
|
typename Functions<StreamType>::Iterator Functions<StreamType>::Begin()
|
||||||
|
{
|
||||||
|
return functions_tab.begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class StreamType>
|
||||||
|
typename Functions<StreamType>::Iterator Functions<StreamType>::End()
|
||||||
|
{
|
||||||
|
return functions_tab.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class StreamType>
|
template<class StreamType>
|
||||||
size_t Functions<StreamType>::Size() const
|
size_t Functions<StreamType>::Size() const
|
||||||
|
|
Loading…
Reference in New Issue