Aegis  4.25.D505
libaegis/file/event/list.h
Go to the documentation of this file.
00001 //
00002 //      aegis - project change supervisor
00003 //      Copyright (C) 2006-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_FILE_EVENT_LIST_H
00021 #define LIBAEGIS_FILE_EVENT_LIST_H
00022 
00023 #include <common/ac/stddef.h>
00024 
00025 class file_event; // forward
00026 
00031 class file_event_list
00032 {
00033 public:
00034     typedef aegis_shared_ptr<file_event_list> pointer;
00035 
00039     virtual ~file_event_list();
00040 
00041 private:
00046     file_event_list();
00047 
00052     file_event_list(const file_event_list &);
00053 
00058     file_event_list &operator=(const file_event_list &);
00059 
00060 public:
00061     static pointer create();
00062 
00063     static pointer create(const pointer &arg);
00064 
00065     size_t size() const { return length; }
00066     void clear();
00067     void push_back(const file_event_list &arg);
00068     void push_back(file_event *arg);
00069 
00070     file_event *get(size_t n) const { return item[n]; }
00071     file_event *operator[](size_t n) const { return get(n); }
00072     bool empty() const { return (length == 0); }
00073     file_event *back() const { return item[length - 1]; }
00074 
00075 private:
00076     size_t length;
00077     size_t maximum;
00078     file_event **item;
00079 };
00080 
00081 #endif // LIBAEGIS_FILE_EVENT_LIST_H