Browse Source

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
master 0.9.5
Tomasz Sowa 10 years ago
parent
commit
c6b4db0aa9
  1. 24
      src/functions.h

24
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<std::wstring, Function> 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<std::wstring, Function> FunctionsTable;
FunctionsTable functions_tab;
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>
size_t Functions<StreamType>::Size() const

Loading…
Cancel
Save