Aegis  4.25.D505
libaegis/sub/functor/list.h
Go to the documentation of this file.
00001 //
00002 //      aegis - project change supervisor
00003 //      Copyright (C) 2007, 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_SUB_FUNCTOR_LIST_H
00021 #define LIBAEGIS_SUB_FUNCTOR_LIST_H
00022 
00023 #include <libaegis/sub/functor.h>
00024 
00029 class sub_functor_list
00030 {
00031 public:
00035     virtual ~sub_functor_list();
00036 
00040     sub_functor_list();
00041 
00049     void push_back(sub_functor::pointer sfp);
00050 
00058     sub_functor::pointer get(size_t n) const;
00059 
00067     sub_functor::pointer operator[](size_t n) const { return get(n); }
00068 
00073     size_t size() const { return length; }
00074 
00079     bool empty() const { return !length; }
00080 
00092     void match(const nstring &name, sub_functor_list &result);
00093 
00097     void clear();
00098 
00109     sub_functor::pointer find(const nstring &name) const;
00110 
00111 private:
00117     sub_functor::pointer *list;
00118 
00123     size_t length;
00124 
00129     size_t maximum;
00130 
00134     sub_functor_list(const sub_functor_list &);
00135 
00139     sub_functor_list &operator=(const sub_functor_list &);
00140 };
00141 
00142 #endif // LIBAEGIS_SUB_FUNCTOR_LIST_H