00001 #ifndef SEQUENCE_FACTORY_H_
00002 #define SEQUENCE_FACTORY_H_
00003
00004 #include "random_sequence.h"
00005 #include "cksequence_internal.h"
00006 #include "strided_sequence.h"
00007
00014 template <typename T>
00015 class CkSequenceFactory {
00016 public:
00017 static CkSequenceInternal<T>* CreateRandomSequence() {
00018 return new RandomSequence<T>();
00019 }
00020
00021 template <typename GenericIterator>
00022 static CkSequenceInternal<T>* CreateRandomSequence(const GenericIterator& begin,
00023 const GenericIterator& end) {
00024 return new RandomSequence<T>(begin, end);
00025 }
00026
00027 static CkSequenceInternal<T>* CreateRandomSequence(char* bit_vector, int
00028 start_ele, int end_ele) {
00029 return new RandomSequence<T>(bit_vector, start_ele, end_ele);
00030 }
00031
00032 static CkSequenceInternal<T>* CreateStridedSequence() {
00033 return new StridedSequence<T>();
00034 }
00035
00036 static CkSequenceInternal<T>* CreateStridedSequence(T start_element, T stride,
00037 T end_element) {
00038 return new StridedSequence<T>(start_element, stride, end_element);
00039 }
00040 };
00041
00042 #endif // SEQUENCE_FACTORY_H_