nmapitem.hpp

Go to the documentation of this file.
00001 // LICENSE: (Please see the file COPYING for details)
00002 //
00003 // NUS - Nemesis Utilities System: A C++ application development framework 
00004 // Copyright (C) 2006, 2008 Otavio Rodolfo Piske
00005 //
00006 //  This file is part of NUS
00007 //
00008 //  This library is free software; you can redistribute it and/or
00009 //  modify it under the terms of the GNU Lesser General Public
00010 //  License as published by the Free Software Foundation version 2.1
00011 //  of the License.
00012 //
00013 //  This library is distributed in the hope that it will be useful,
00014 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016 //  Lesser General Public License for more details.
00017 //
00018 //  You should have received a copy of the GNU Lesser General Public
00019 //  License along with this library; if not, write to the Free Software
00020 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021 //
00022 #ifndef NMAPITEM_HPP
00023 #define NMAPITEM_HPP
00024 
00033 template <typename K, typename V>
00034 class NMapItem {
00035       public:
00036             K key;      
00037             V value;    
00042             NMapItem(void)
00043                   : key(),
00044                   value()           
00045             {}
00046 
00052             bool operator==(const NMapItem<K, V> &rhs) const {
00053                   if (key == rhs.key && value == rhs.value) {
00054                         return true;
00055                   }
00056                   
00057                   return false;
00058             }
00059 
00065             bool operator!=(const NMapItem<K, V> &rhs) const {
00066                   if (key != rhs.key || value != rhs.value) {
00067                         return false;
00068                   }
00069                   
00070                   return true;
00071             }
00072             
00078             bool operator>(const NMapItem<K, V> &rhs) const {
00079                   if (key > rhs.key) {
00080                         return true;
00081                   }
00082                   
00083                   return false;
00084             }
00085             
00086             
00092             bool operator<(const NMapItem<K, V> &rhs) const {
00093                   if (key < rhs.key) {
00094                         return true;
00095                   }
00096                   
00097                   return false;
00098             }
00099             
00100             
00107             bool operator>=(const NMapItem<K, V> &rhs) const {
00108                   if (key > rhs.key) {
00109                         return true;
00110                   }
00111                   
00112                   if (key == rhs.key && value == rhs.value) {
00113                         return true;
00114                   }
00115                   
00116                   return false;
00117             }
00118             
00125             bool operator<=(const NMapItem<K, V> &rhs) const {
00126                   if (key < rhs.key) {
00127                         return true;
00128                   }
00129                   
00130                   if (key == rhs.key && value == rhs.value) {
00131                         return true;
00132                   }
00133                   
00134                   return false;
00135             }
00136 };
00137 
00138 #endif // NMAPITEM_HPP

Generated on Wed Mar 5 23:10:35 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4