diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2016-09-19 21:14:58 +0000 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2016-09-19 21:14:58 +0000 |
commit | 210f77d2c32f14d2e99577fd3c9842bb19d47e50 (patch) | |
tree | 5edb327c919b8309e301c3440fb6668a0075c8ef /omegalib/omega/include/basic/Collection.h | |
parent | a66ce5cd670c4d3c0dc449720f5bc45dd4c281b8 (diff) | |
download | chill-210f77d2c32f14d2e99577fd3c9842bb19d47e50.tar.gz chill-210f77d2c32f14d2e99577fd3c9842bb19d47e50.tar.bz2 chill-210f77d2c32f14d2e99577fd3c9842bb19d47e50.zip |
Moved most modules into lib
Diffstat (limited to 'omegalib/omega/include/basic/Collection.h')
-rw-r--r-- | omegalib/omega/include/basic/Collection.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/omegalib/omega/include/basic/Collection.h b/omegalib/omega/include/basic/Collection.h deleted file mode 100644 index 80ddf48..0000000 --- a/omegalib/omega/include/basic/Collection.h +++ /dev/null @@ -1,43 +0,0 @@ -#if !defined Already_Included_Collection -#define Already_Included_Collection - -namespace omega { - -template<class T> class Iterator; -template<class T> class Any_Iterator; - - -//! protocol for any kind of collection -template<class T> class Collection { -public: - virtual Iterator<T> *new_iterator() = 0; - virtual Any_Iterator<T> any_iterator() { return Any_Iterator<T>(new_iterator()); } - - virtual int size() const = 0; -}; - - -/*! - * protocol for collections whose elements are ordered - * by the way they are entered into the collection, and - * whose elements can be accessed by "index" - * - * note that the implementation need not be a linked list - */ -template<class T> class Sequence : public Collection<T> { -public: - virtual const T &operator[](int) const = 0; - virtual T &operator[](int) = 0; - - /*! Y in X --> X[X.index(Y)] == Y */ - virtual int index(const T &) const = 0; }; - -} // namespace - -#define instantiate_Collection(T) template class Collection<T>; \ - instantiate_Any_Iterator(T) -#define instantiate_Sequence(T) template class Sequence<T>; \ - instantiate_Collection(T) - -#endif - |