X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fcore%2Futil%2FLRUMap.hpp;h=bc5141e2015008fbce4db00c6b7819492c2aa7e5;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=14c85cfc5edf6ec4d778d78a2b71c805c62f9b26;hpb=39033fd99e58e994a5e98c1060dcc79e0d81f9c9;p=anna.git diff --git a/include/anna/core/util/LRUMap.hpp b/include/anna/core/util/LRUMap.hpp index 14c85cf..bc5141e 100644 --- a/include/anna/core/util/LRUMap.hpp +++ b/include/anna/core/util/LRUMap.hpp @@ -1,37 +1,9 @@ -// ANNA - Anna is Not Nothingness Anymore -// -// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo -// -// http://redmine.teslayout.com/projects/anna-suite -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Authors: eduardo.ramos.testillano@gmail.com -// cisco.tierra@gmail.com +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // #ifndef anna_core_util_LRUMap_hpp @@ -81,13 +53,13 @@ public: Devuelve el indicador de validez de esta media. \return \em true Si la media no tiene ningun valor o \em false en caso contrario. */ - bool isEmpty() const throw() { return a_container.size() == 0; } + bool isEmpty() const { return a_container.size() == 0; } /** * Devuelve el número de elementos contenidos en este contenedor. * \return el número de elementos contenidos en este contenedor. */ - int size() const throw() { return a_container.size(); } + int size() const { return a_container.size(); } /** * Devuelve el puntero al valor asociado a la clave recibida como parámetro. @@ -97,7 +69,7 @@ public: * * \return El puntero al valor asociado a la clave recibida como parámetro. * */ - V* find(const K& key) throw() { + V* find(const K& key) { iterator ii = a_container.find(key); if(ii == end()) @@ -117,7 +89,7 @@ public: * \param key Clave de la pareja (K,V). * \param v Valor asociado a la clave. */ - void add(const K& key, const V& v) throw() { + void add(const K& key, const V& v) { iterator ii = a_container.find(key); // Sobreescribe el valor asociado a K y actualiza su tiempo de acceso. @@ -156,35 +128,35 @@ public: /** Vacía este contenedor. */ - void clear() throw() { a_container.clear(); } + void clear() { a_container.clear(); } /** * Devuelve un iterator al primer elemento del contenedor, teniendo que la ordenación de los * pares (K,V) se hará en base a K. * \return El primer elemento del contenedor. */ - iterator begin() throw() { return a_container.begin(); } + iterator begin() { return a_container.begin(); } /** * Devuelve un iterator al primer elemento del contenedor, teniendo que la ordenación de los * pares (K,V) se hará en base a K. * \return El primer elemento del contenedor. */ - const_iterator begin() const throw() { return a_container.begin(); } + const_iterator begin() const { return a_container.begin(); } /** * Devuelve un iterator al final del contenedor, teniendo que la ordenación de los pares (K,V) se hará en * base a K. * \return El primer elemento del contenedor. */ - iterator end() throw() { return a_container.end(); } + iterator end() { return a_container.end(); } /** * Devuelve un iterator al final del contenedor, teniendo que la ordenación de los pares (K,V) se hará en * base a K. * \return El primer elemento del contenedor. */ - const_iterator end() const throw() { return a_container.end(); } + const_iterator end() const { return a_container.end(); } /** * Devuelve la clave asociada al iterador recibido como parámetro. @@ -192,7 +164,7 @@ public: * \return la clave asociada al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static K key(iterator& ii) throw() { return ii->first; } + static K key(iterator& ii) { return ii->first; } /** * Devuelve el valor asociado al iterador recibido como parámetro. @@ -200,7 +172,7 @@ public: * \return el valor asociado al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static V& value(iterator& ii) throw() { + static V& value(iterator& ii) { timed_value* v = &ii->second; return v->first; } @@ -210,7 +182,7 @@ public: * \param ii Iterador que debe estar comprendido entre [#begin (), #end). * \return el tiempo de acceso asociado al iterador recibido como parámetro. */ - static Millisecond& millisecond(iterator& ii) throw() { + static Millisecond& millisecond(iterator& ii) { timed_value* v = &ii->second; return v->second; } @@ -221,7 +193,7 @@ public: * \return la clave asociada al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static K key(const_iterator& ii) throw() { return ii->first; } + static K key(const_iterator& ii) { return ii->first; } /** * Devuelve el valor asociado al iterador recibido como parámetro. @@ -229,7 +201,7 @@ public: * \return el valor asociado al iterador recibido como parámetro. * \warning Los acceso mediante iterador no actualiza el tiempo de acceso a la pareja (K,V). */ - static const V& value(const_iterator& ii) throw() { + static const V& value(const_iterator& ii) { const timed_value* v = &ii->second; return v->first; } @@ -239,7 +211,7 @@ public: * \param ii Iterador que debe estar comprendido entre [#begin (), #end). * \return el tiempo de acceso asociado al iterador recibido como parámetro. */ - static Millisecond millisecond(const_iterator& ii) throw() { + static Millisecond millisecond(const_iterator& ii) { const timed_value* v = &ii->second; return v->second; } @@ -249,7 +221,7 @@ public: \return Una cadena con la informacion referente a esta clase. */ std::string asString() const - throw() { + { std::string msg("LRUMap { Name: "); msg += a_name; msg += functions::asText(" | N: ", a_maxSize);