00001 #ifndef MAININDEXES_H 00002 #define MAININDEXES_H 00003 00004 #include "asset.inc" 00005 #include "condition.inc" 00006 #include "file.inc" 00007 #include "indexfile.inc" 00008 #include "mutex.inc" 00009 #include "mwindow.inc" 00010 #include "thread.h" 00011 00012 // Runs in a loop, creating new index files as needed 00013 00014 class MainIndexes : public Thread 00015 { 00016 public: 00017 MainIndexes(MWindow *mwindow); 00018 ~MainIndexes(); 00019 00020 void add_next_asset(File *file, Asset *asset); 00021 00022 void start_loop(); 00023 void stop_loop(); 00024 void start_build(); 00025 void run(); 00026 void interrupt_build(); 00027 void load_next_assets(); 00028 void delete_current_assets(); 00029 00030 ArrayList<Asset*> current_assets; 00031 ArrayList<Asset*> next_assets; 00032 00033 int interrupt_flag; // Build process interrupted by user 00034 int done; // Program quit 00035 MWindow *mwindow; 00036 Condition *input_lock; // Lock until new data is to be indexed 00037 Mutex *next_lock; // Lock changes to next assets 00038 Condition *interrupt_lock; // Force blocking until thread is finished 00039 IndexFile *indexfile; 00040 }; 00041 00042 #endif
1.4.4