00001
00002
00003
00004
00005
00006
00007
00008 #ifndef EDG_WORKLOAD_COMMON_UTILITIES_FLEXTRACTOR_H
00009 #define EDG_WORKLOAD_COMMON_UTILITIES_FLEXTRACTOR_H
00010
00011 #ifndef EDG_WORKLOAD_X_STRING
00012 #define EDG_WORKLOAD_X_STRING
00013 #include <string>
00014 #endif
00015 #ifndef EDG_WORKLOAD_X_UTILITY
00016 #define EDG_WORKLOAD_X_UTILITY
00017 #include <utility>
00018 #endif
00019 #ifndef EDG_WORKLOAD_X_VECTOR
00020 #define EDG_WORKLOAD_X_VECTOR
00021 #include <vector>
00022 #endif
00023 #ifndef EDG_WORKLOAD_COMMON_UTILITIES_FILELIST_H
00024 #include "edg/workload/common/utilities/FileList.h"
00025 #endif
00026 #ifndef EDG_WORKLOAD_COMMON_UTILITIES_FILELISTLOCK_H
00027 #include "edg/workload/common/utilities/FileListLock.h"
00028 #endif
00029 #ifndef EDG_WORKLOAD_COMMON_UTILITIES_EXTRACTOR_H
00030 #include "edg/workload/common/utilities/Extractor.h"
00031 #endif
00032
00033 namespace edg {
00034 namespace workload {
00035 namespace common {
00036 namespace utilities {
00037
00038 template<typename T>
00039 class FLExtractor
00040 {
00041 typedef typename edg::workload::common::utilities::FileList<T> FL;
00042 typedef edg::workload::common::utilities::FileListMutex FLM;
00043 typedef edg::workload::common::utilities::ForwardExtractor<FL> FE;
00044
00045 FL m_filelist;
00046 FLM m_mutex;
00047 FE m_extractor;
00048
00049 public:
00050 typedef typename FE::iterator iterator;
00051 typedef typename FE::value_type value_type;
00052
00053 public:
00054 FLExtractor(const std::string& file);
00055 ~FLExtractor();
00056
00057 std::pair<iterator, bool> try_get_one();
00058 std::vector<iterator> get_all_available();
00059 void erase(const iterator& it);
00060
00061 };
00062
00063 }
00064 }
00065 }
00066 }
00067
00068 #include "edg/workload/common/utilities/FLExtractor.cpp"
00069
00070 #endif