00001 // Degrees.h -- The interface to a cache of variable degrees. 00002 00003 /* 00004 * Copyright (C) 2004 Tudor Hulubei <tudor@hulubei.net>. 00005 * 00006 * This library is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU Lesser General Public License as 00008 * published by the Free Software Foundation; either version 2, or (at 00009 * your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 00019 * 02111-1307, USA. 00020 */ 00021 00022 /* 00023 * NOTE: This is an interal header file. 00024 * You should not attempt to use it directly. 00025 */ 00026 00027 // $Id: Degrees_8h-source.html,v 1.1 2005/05/25 12:37:18 tudor Exp $ 00028 00029 #ifndef _CSP_CACHES_Degrees_H 00030 #define _CSP_CACHES_Degrees_H 00031 00032 00033 CSP_NAMESPACE_BEGIN(csp); 00034 CSP_NAMESPACE_BEGIN(caches); 00035 00036 00040 class CSP_API Degrees 00041 { 00042 public: 00044 Degrees() {} 00045 00053 size_t degree(const Variable& variable); 00054 00060 void updateDegree(const Variable& variable); 00061 00063 void clear() { m_degrees.clear(); } 00064 00066 bool empty() { return m_degrees.empty(); } 00067 00068 private: 00070 Degrees(const Degrees&); 00071 00073 Degrees& operator=(const Degrees&); 00074 00076 typedef hash_map<const Variable*, size_t> vd_type; 00077 00079 vd_type m_degrees; 00080 }; 00081 00082 00083 CSP_NAMESPACE_END(cache); 00084 CSP_NAMESPACE_END(csp); 00085 00086 00087 #endif // _CSP_CACHES_Degrees_H 00088 00089 // Local Variables: 00090 // mode: C++ 00091 // End:
1.3.9.1