00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2001-2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_PROJECT_FILE_ROLL_FORWARD_H 00021 #define LIBAEGIS_PROJECT_FILE_ROLL_FORWARD_H 00022 00023 #include <common/ac/time.h> 00024 00025 #include <common/symtab/template.h> 00026 #include <libaegis/change/list.h> 00027 #include <libaegis/fstate.h> 00028 #include <libaegis/project.h> 00029 #include <libaegis/file/event/list.h> 00030 00031 class nstring_list; // forward 00032 struct cstate_src_ty; // forward 00033 class file_event; 00034 00035 00036 class project_file_roll_forward 00037 { 00038 public: 00042 virtual ~project_file_roll_forward(); 00043 00047 project_file_roll_forward(); 00048 00052 project_file_roll_forward(project_ty *pp, time_t limit, int detailed); 00053 00074 void set(project_ty *pp, time_t limit, int detailed); 00075 00092 file_event_list::pointer get(fstate_src_ty *src); 00093 00110 file_event_list::pointer get(cstate_src_ty *src); 00111 00126 file_event_list::pointer get(const nstring &filename); 00127 00144 file_event_list::pointer get(string_ty *filename); 00145 00156 file_event *get_last(const nstring &filename); 00157 00170 file_event *get_last(string_ty *filename); 00171 00183 file_event *get_last(fstate_src_ty *src); 00184 00195 file_event *get_older(const nstring &filename); 00196 00209 file_event *get_older(string_ty *filename); 00210 00218 void keys(nstring_list &file_name_list); 00219 00227 bool is_set() const { return !uuid_to_felp.empty(); } 00228 00233 change::pointer get_last_change() const; 00234 00235 private: 00244 file_event_list::pointer get_by_uuid(string_ty *uuid); 00245 00251 symtab<file_event_list::pointer> uuid_to_felp; 00252 00258 symtab<string_ty> filename_to_uuid; 00259 00264 time_t stp_time; 00265 00270 change::pointer last_change; 00271 00288 time_t recapitulate(project_ty *pp, time_t limit, int detailed); 00289 00293 project_file_roll_forward(const project_file_roll_forward &); 00294 00298 project_file_roll_forward &operator=(const project_file_roll_forward &); 00299 }; 00300 00301 #endif // LIBAEGIS_PROJECT_FILE_ROLL_FORWARD_H