Aegis  4.25.D505
/home/archives/aegis/branch.4/branch.25/delta28933.505/libaegis/project/file/roll_forward.h
Go to the documentation of this file.
00001 //
00002 // aegis - project change supervisor
00003 // Copyright (C) 2001-2008, 2011, 2012 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 (at
00008 // 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 GNU
00013 // 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 <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef LIBAEGIS_PROJECT_FILE_ROLL_FORWARD_H
00020 #define LIBAEGIS_PROJECT_FILE_ROLL_FORWARD_H
00021 
00022 #include <common/ac/time.h>
00023 
00024 #include <common/symtab/template.h>
00025 #include <libaegis/change/list.h>
00026 #include <libaegis/fstate.fmtgen.h>
00027 #include <libaegis/project.h>
00028 #include <libaegis/file/event/list.h>
00029 
00030 class nstring_list; // forward
00031 struct cstate_src_ty; // forward
00032 class file_event;
00033 
00034 
00035 class project_file_roll_forward
00036 {
00037 public:
00041     virtual ~project_file_roll_forward();
00042 
00046     project_file_roll_forward();
00047 
00062     project_file_roll_forward(project *pp, time_t limit, bool detailed);
00063 
00083     void set(project *pp, time_t limit, bool detailed);
00084 
00099     file_event_list::pointer get(fstate_src_ty *src);
00100 
00117     file_event_list::pointer get(cstate_src_ty *src);
00118 
00131     file_event_list::pointer get(const nstring &filename);
00132 
00147     file_event_list::pointer get(string_ty *filename);
00148 
00159     file_event *get_last(const nstring &filename);
00160 
00173     file_event *get_last(string_ty *filename);
00174 
00186     file_event *get_last(fstate_src_ty *src);
00187 
00201     nstring_list get_last_dir(const nstring &dirname);
00202 
00213     nstring get_last_fuzzy(const nstring &filename);
00214 
00225     file_event *get_older(const nstring &filename);
00226 
00239     file_event *get_older(string_ty *filename);
00240 
00248     void keys(nstring_list &file_name_list);
00249 
00257     bool is_set(void) const { return !uuid_to_felp.empty(); }
00258 
00263     change::pointer get_last_change(void) const;
00264 
00265 private:
00274     file_event_list::pointer get_by_uuid(string_ty *uuid);
00275 
00281     symtab<file_event_list::pointer> uuid_to_felp;
00282 
00288     symtab<string_ty> filename_to_uuid;
00289 
00294     time_t stp_time;
00295 
00300     change::pointer last_change;
00301 
00318     time_t recapitulate(project *pp, time_t limit, bool detailed);
00319 
00323     project_file_roll_forward(const project_file_roll_forward &);
00324 
00328     project_file_roll_forward &operator=(const project_file_roll_forward &);
00329 };
00330 
00331 #endif // LIBAEGIS_PROJECT_FILE_ROLL_FORWARD_H
00332 // vim: set ts=8 sw=4 et :