contactlist.h

00001 /***************************************************************************
00002                           contactlist.h  -  description
00003                              -------------------
00004     begin                : mar avr 11 2006
00005     copyright            : (C) 2006 by Sylvain Archenault <sylvain.archenault@laposte.net>, \n Yves Houpert <yves.houpert@insa-rouen.fr> <>
00006  
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 #ifndef CONTACTLIST_H
00018 #define CONTACTLIST_H
00019 
00020 #include <list>
00021 #include <contact.h>
00022 
00023 
00024 typedef std::list<Contact>::iterator ContactListIterator;
00025 typedef std::list<Contact>::const_iterator ContactListConstIterator;
00026 
00033 class ContactList
00034 {
00035 public:
00037   ContactList();
00038 
00040   ~ContactList();
00041 
00048   const Contact* addContact(const Contact& contact);
00049 
00054   bool isContactInList(const Contact& contact);
00055 
00060   bool removeContact(const int ID);
00061 
00066   bool removeContact(const Contact& contact);
00067 
00071   std::string toString() const;
00072 
00077   ContactListConstIterator begin() const { return m_list.begin(); }
00078 
00083   ContactListConstIterator end() const { return m_list.end(); }
00084 
00086   void clear();
00087 
00091   const Contact* const getContact(const int contactID) const;
00092 
00096   Contact* getContact(const int contactID);
00097 
00098 private:  // private members
00100   std::list<Contact> m_list;
00101 
00102 };
00103 
00104 
00105 #endif
00106 

Generated on Fri May 19 12:15:54 2006 for Bamboo Ch@t by  doxygen 1.4.6