X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fhttp%2Fwims20%2FAbstract.hpp;h=ac9a78311b66741141b2cc6fe1e70f58419ee484;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=90a837b844026ee4fb2ed9dd3f1a9fdadee92c7b;hpb=3e258840b15577cb8bda3cdedd0b9b88e16404b3;p=anna.git diff --git a/include/anna/http/wims20/Abstract.hpp b/include/anna/http/wims20/Abstract.hpp index 90a837b..ac9a783 100644 --- a/include/anna/http/wims20/Abstract.hpp +++ b/include/anna/http/wims20/Abstract.hpp @@ -1,37 +1,9 @@ -// ANNA - Anna is Not Nothingness Anymore -// -// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo -// -// https://bitbucket.org/testillano/anna -// -// 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 Google Inc. 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_http_wims20_Abstract_hpp @@ -97,56 +69,56 @@ public: * Devuelve el campo \em domain-openapis establecido en el contructor. * \return el campo \em domain-openapis establecido en el contructor. */ - const std::string& getDomain() const throw() { return a_domain; } + const std::string& getDomain() const { return a_domain; } /** * Devuelve el campo \em path-openapis * \return El campo \em path-openapis, puede ser NULL. */ - const std::string* getPath() const throw() { return a_path; } + const std::string* getPath() const { return a_path; } /** * Devuelve el servicio de la OpenAPI. * \param Identificador de servicio usado en la OpenAPI. */ - const std::string& getServiceID() const throw() { return a_serviceID; } + const std::string& getServiceID() const { return a_serviceID; } /** * Devuelve identificador de usuario que interacciona con el servicio. * \return El identificador de usuario que interacciona con el servicio. */ - const std::string& getGUID() const throw() { return a_guid; } + const std::string& getGUID() const { return a_guid; } /** * Establece el servicio de la OpenAPI. * \param serviceID Identificador de servicio usado en la OpenAPI. */ - void setServiceID(const std::string& serviceID) throw() { a_serviceID = serviceID; a_fixedPart.clear(); } + void setServiceID(const std::string& serviceID) { a_serviceID = serviceID; a_fixedPart.clear(); } /** * Establece el identificador de usuario que interacciona con el servicio. * \param guid Identificador de usuario. Dónde por usuario se entiende cualquier elemento * que pueda intereccionar con nuestro servicio */ - void setGUID(const std::string& guid) throw() { a_guid = guid; a_fixedPart.clear(); } + void setGUID(const std::string& guid) { a_guid = guid; a_fixedPart.clear(); } /** * Devuelve \em true si la estructura contiene parámetros o \em false en otro caso. * \return \em true si la estructura contiene parámetros o \em false en otro caso. */ - bool hasParameters() const throw() { return a_parameters != NULL && a_parameters->empty() == false; } + bool hasParameters() const { return a_parameters != NULL && a_parameters->empty() == false; } /** * Devuelve \em true si la estructura contiene niveles opcionales o \em false en otro caso. * \return \em true si la estructura contiene niveles opcionales o \em false en otro caso. */ - bool hasOtherLevels() const throw() { return a_otherLevels != NULL && a_otherLevels->empty() == false; } + bool hasOtherLevels() const { return a_otherLevels != NULL && a_otherLevels->empty() == false; } /** * Limpia el contenido asociado al parámetro \em other_possible_level. Sólo debería * invocarse a este método en caso de que el servicio destino de la petición haya cambiado. */ - virtual void clearOtherLevels() throw(); + virtual void clearOtherLevels() ; /** * Limpia el contenido asociado a los parámetros. Sólo debería invocarse a éste método en caso @@ -154,12 +126,12 @@ public: * Si son los mismos parámetros con el mismo nombre, deberíamos reutilizar el máximo número * de veces. */ - virtual void clearParameters() throw(); + virtual void clearParameters() ; /** * Inicializa los toda la información asociada a esta instancia. */ - void clear() throw() { + void clear() { clearOtherLevels(); clearParameters(); } @@ -168,77 +140,77 @@ public: * Devuelce una cadena con la información relevante sobre esta clase. * \return una cadena con la información relevante sobre esta clase. */ - std::string asString() const throw(); + std::string asString() const ; /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - other_level_iterator other_level_begin() throw() { return a_otherLevels->begin(); } + other_level_iterator other_level_begin() { return a_otherLevels->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - other_level_iterator other_level_end() throw() { return a_otherLevels->end(); } + other_level_iterator other_level_end() { return a_otherLevels->end(); } /** * Devuelve el valor asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor asociado al iterador. */ - static std::string* otherLevel(other_level_iterator ii) throw() { return *ii; } + static std::string* otherLevel(other_level_iterator ii) { return *ii; } /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - const_other_level_iterator other_level_begin() const throw() { return a_otherLevels->begin(); } + const_other_level_iterator other_level_begin() const { return a_otherLevels->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasOtherLevels devuelve \em true. */ - const_other_level_iterator other_level_end() const throw() { return a_otherLevels->end(); } + const_other_level_iterator other_level_end() const { return a_otherLevels->end(); } /** * Devuelve el valor asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor asociado al iterador. */ - static const std::string& otherLevel(const_other_level_iterator ii) throw() { return **ii; } + static const std::string& otherLevel(const_other_level_iterator ii) { return **ii; } /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - const_parameter_iterator parameter_begin() const throw() { return a_parameters->begin(); } + const_parameter_iterator parameter_begin() const { return a_parameters->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - const_parameter_iterator parameter_end() const throw() { return a_parameters->end(); } + const_parameter_iterator parameter_end() const { return a_parameters->end(); } /** * Devuelve el nombre del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el nombre del parámetro asociado al iterador. */ - static const std::string& parameter_name(const_parameter_iterator ii) throw() { return *(ii->first); } + static const std::string& parameter_name(const_parameter_iterator ii) { return *(ii->first); } /** * Devuelve el valor del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor del parámetro asociado al iterador. */ - static const std::string& parameter_value(const_parameter_iterator ii) throw() { return *(ii->second); } + static const std::string& parameter_value(const_parameter_iterator ii) { return *(ii->second); } protected: other_level_container* a_otherLevels; @@ -264,26 +236,26 @@ protected: * Mientras estos dos últimos campos se mantengan constrantes, el resultado de este método no cambia. * \return Una cadena con la parte fija de la petición. */ - const std::string& calculeFixedPart() throw(RuntimeException); + const std::string& calculeFixedPart() noexcept(false); /** * Calcula la parte fija corta de la petición. Tiene en cuenta el \em domain-openapis y si existe * el path-openapis. Si fuera necesario incluye el identificador de protocolo "http://". * \return Una cadena con la parte fija corta de la petición. */ - const std::string& calculeShortFixedPart() throw(RuntimeException); + const std::string& calculeShortFixedPart() noexcept(false); /** * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - std::string* createString() throw(RuntimeException) { return a_string_pool.create(); } + std::string* createString() noexcept(false) { return a_string_pool.create(); } /** * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - std::string* createString(const char* value) throw(RuntimeException) { + std::string* createString(const char* value) noexcept(false) { std::string* result = a_string_pool.create(); *result = value; return result; @@ -293,59 +265,59 @@ protected: * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - std::string* createString(const std::string& value) throw(RuntimeException) { return createString(value.c_str()); } + std::string* createString(const std::string& value) noexcept(false) { return createString(value.c_str()); } /** * Optimiza la creación y liberación de cadenas que usa el proceso de interpretación continuamente. * \warning Exclusivamente uso interno. */ - void destroyString(std::string* str) throw() { a_string_pool.release(str); } + void destroyString(std::string* str) { a_string_pool.release(str); } /** * Amplía la lista de niveles. * \param otherLevel Nombre del nivel con el que ampliar las lista. */ - void other_level_add(const std::string& otherLevel) throw(RuntimeException); + void other_level_add(const std::string& otherLevel) noexcept(false); /** * Amplía la lista de parámetros con una nueva pareja (Nombre, Valor). * \param name Nombre del parámetro a crear. * \param value Valor asociado al parámetro. */ - void parameter_set(const std::string& name, const std::string& value) throw(RuntimeException); + void parameter_set(const std::string& name, const std::string& value) noexcept(false); /** * Devuelve un iterator al comienzo de la lista de niveles adicionales. * \return un iterator al comienzo de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - parameter_iterator parameter_begin() throw() { return a_parameters->begin(); } + parameter_iterator parameter_begin() { return a_parameters->begin(); } /** * Devuelve un iterator al final de la lista de niveles adicionales. * \return un iterator al final de la lista de niveles adicionales. * \warning Sólo se puede invocar a este método si #hasParameters devuelve \em true. */ - parameter_iterator parameter_end() throw() { return a_parameters->end(); } + parameter_iterator parameter_end() { return a_parameters->end(); } /** * Devuelve el nombre del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el nombre del parámetro asociado al iterador. */ - static std::string* parameter_name(parameter_iterator ii) throw() { return ii->first; } + static std::string* parameter_name(parameter_iterator ii) { return ii->first; } /** * Devuelve el valor del parámetro asociado al iterador. * \param ii Iterador sobre los niveles opcionales. * \return el valor del parámetro asociado al iterador. */ - static std::string* parameter_value(parameter_iterator ii) throw() { return ii->second; } + static std::string* parameter_value(parameter_iterator ii) { return ii->second; } /** * Concatena las cadenas recibidas teniendo en entre ambas debe de haber un carácter '/'. */ - static void appendWithSlash(std::string& target, const std::string& other) throw(); + static void appendWithSlash(std::string& target, const std::string& other) ; private: const std::string a_whatis;