00001 #ifndef SEQUENCE_INTERNAL_H 00002 #define SEQUENCE_INTERNAL_H 00003 00004 #include <vector> 00005 #include "pup.h" 00006 00010 enum Type {RANDOM, STRIDE}; 00011 template <typename T> 00012 struct StrideInfo { 00013 T start_element; 00014 T stride; 00015 T end_element; 00016 }; 00017 00023 template <typename T> 00024 class CkSequenceIteratorInternal { 00025 public: 00026 00027 00028 virtual T operator*() = 0; 00029 virtual void operator++() = 0; 00030 virtual void operator++(int) = 0; 00031 virtual void operator--() = 0; 00032 virtual void operator--(int) = 0; 00033 virtual bool operator==(const CkSequenceIteratorInternal& rhs) const = 0; 00034 virtual bool operator!=(const CkSequenceIteratorInternal& rhs) const = 0; 00035 }; 00036 00042 template <typename T> 00043 class CkSequenceInternal { 00044 public: 00045 00046 00047 virtual void Insert(const T& element) = 0; 00048 00049 virtual void Remove(const T& element) = 0; 00050 00051 virtual int num_elements() const = 0; 00052 00053 virtual T min() const = 0; 00054 00055 virtual T max() const = 0; 00056 00057 virtual Type type() const = 0; 00058 00059 virtual CkSequenceIteratorInternal<T>* begin() = 0; 00060 00061 virtual CkSequenceIteratorInternal<T>* end() = 0; 00062 00063 // Returns the size of the memory for internal representation of the elements 00064 virtual int mem_size() const = 0; 00065 virtual void pup(PUP::er &p) = 0; 00066 }; 00067 00068 #endif // SEQUENCE_INTERNAL_H