X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Ftimex%2FEngine.hpp;h=ff8555cb1ae88d5b07a21e54b7e87a9fc47aa42f;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hp=2c07c170a0167e7e845d70ce2f70756495bf1c35;hpb=4e12ac57e93c052f716a6305ad8fc099c45899d1;p=anna.git diff --git a/include/anna/timex/Engine.hpp b/include/anna/timex/Engine.hpp index 2c07c17..ff8555c 100644 --- a/include/anna/timex/Engine.hpp +++ b/include/anna/timex/Engine.hpp @@ -1,37 +1,9 @@ -// ANNA - Anna is Not 'N' 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_timex_Engine_hpp @@ -73,7 +45,7 @@ class TickProducer; #include void cualquierFuncion (Timer* timer) - throw (RuntimeException) + noexcept(false) { Engine* timeController = anna::component (FILE_LOCATION); timerController->activate (timer); @@ -99,7 +71,7 @@ public: Asocia automatica el objeto controlador de tiempo a la instancia de nuestra aplicacin. - @param maxTimeout minima duracion de los eventos de tiempo que vamos a establecer. + @param maxTimeout maxima duracion de los eventos de tiempo que vamos a establecer. @param resolution Resolucion ofrecida para este controlador de tiempos. La duracion minima de un evento de tiempo de ser igual o mayor a este parametro. */ @@ -114,13 +86,13 @@ public: Devuelve la resolucion del controlador de tiempo indicada en el contructor. \return la resolucion del controlador de tiempo indicada en el contructor. */ - const Millisecond & getResolution() const throw() { return a_resolution; } + const Millisecond & getResolution() const { return a_resolution; } /** Devuelve el periodo máximo de temporización indicado en el constructor. \return el periodo máximo de temporización indicado en el constructor. */ - const Millisecond & getMaxTimeout() const throw() { return a_maxTimeout; } + const Millisecond & getMaxTimeout() const { return a_maxTimeout; } /** Deja en suspenso la creacion de pulsos de reloj. Los temporizadores que estuvieran activos @@ -128,12 +100,12 @@ public: Para activar el sistema de control de tiempo debe invocarse al metodo play. \warning Si el gestor de tiempo esta en modo pausa no se pueden activar eventos temporales. */ - void pause() throw(RuntimeException); + void pause() noexcept(false); /** Reactiva la creacion de pulsos de reloj despues de la invocacion al metodo pause */ - void play() throw(RuntimeException); + void play() noexcept(false); /** Activa el evento de tiempo recibido como parametro. Si transcurre el tiempo indicado por @@ -142,7 +114,7 @@ public: @param timeEvent Evento de tiempo que vamos a activar. */ - void activate(TimeEvent* timeEvent) throw(RuntimeException); + void activate(TimeEvent* timeEvent) noexcept(false); /** Activa el evento de tiempo recibido como parametro. Si transcurre el tiempo indicado por @@ -152,7 +124,7 @@ public: @param timeEvent Evento de tiempo que vamos a activar. \warning Si el gestor de tiempo esta en modo pausa no se pueden activar eventos temporales. */ - void activate(TimeEvent& timeEvent) throw(RuntimeException) { activate(&timeEvent); } + void activate(TimeEvent& timeEvent) noexcept(false) { activate(&timeEvent); } /** Cancela la ejecucion del evento de tiempo recibido como parametro. Si el evento no esta @@ -161,7 +133,7 @@ public: @param timeEvent Evento de tiempo que vamos a desactivar. \warning Si el gestor de tiempo esta en modo pausa no se pueden activar eventos temporales. */ - void cancel(TimeEvent* timeEvent) throw(RuntimeException); + void cancel(TimeEvent* timeEvent) noexcept(false); /** Cancela la ejecucion del evento de tiempo recibido como parametro. Si el evento no esta @@ -169,7 +141,7 @@ public: @param timeEvent Evento de tiempo que vamos a desactivar. */ - void cancel(TimeEvent& timeEvent) throw(RuntimeException) { cancel(&timeEvent); } + void cancel(TimeEvent& timeEvent) noexcept(false) { cancel(&timeEvent); } /** Obtiene el evento de tiempo asociado al identificador recibido. @@ -179,13 +151,13 @@ public: \return La referencia al evento de tiempo asociado al identificador recibido o NULL en caso de que exista ningn evento que coincida con el identificador. */ - TimeEvent* getTimeEvent(const TimeEvent::Id eventTimeId) throw(); + TimeEvent* getTimeEvent(const TimeEvent::Id eventTimeId) ; /** metodo que podemos reescribir para manejar el evento que nos informa de que el controlador de tiempo va a empezar a comprobar eventos de tiempo caducados. Por defecto no hace nada. */ - virtual void eventBeginQuantum() throw(RuntimeException) {;} + virtual void eventBeginQuantum() noexcept(false) {;} /** metodo que podemos reescribir para manejar el evento que nos informa de que el controlador de @@ -193,20 +165,20 @@ public: @param quantumSize Nmero de eventos procesados en este quantum de tiempo. */ - virtual void eventEndQuantum(const int quantumSize) throw(RuntimeException) {;} + virtual void eventEndQuantum(const int quantumSize) noexcept(false) {;} /** Devuelve una cadena con la informacion mas relevante de esta instancia. \return Una cadena con la informacion mas relevante de esta instancia. */ - virtual std::string asString() const throw(); + virtual std::string asString() const ; /** Devuelve un documento XML con la informacion mas relevante de esta instancia. \param parent Nodo XML del que colgar la informacion referente a esta instancia. \return Un documento XML con la informacion mas relevante de esta instancia. */ - virtual xml::Node* asXML(xml::Node* parent) const throw(); + virtual xml::Node* asXML(xml::Node* parent) const ; /** Devuelve la cadena por la que podemos buscar el componente. @@ -234,20 +206,20 @@ private: Quantum a_delayedQuantum; pthread_t a_threadProducer; - void do_initialize() throw(RuntimeException); - void do_stop() throw(); - void kill() throw(); + void do_initialize() noexcept(false); + void do_stop() ; + void kill() ; - void tick() throw(RuntimeException); - int getQuantum(const int timeout) const throw() { return (a_currentQuantum + (timeout / a_resolution)) % a_maxQuantum; } - void calibrate() throw(); + void tick() noexcept(false); + int getQuantum(const int timeout) const { return (a_currentQuantum + (timeout / a_resolution)) % a_maxQuantum; } + void calibrate() ; // Reimplementado de app::Component - void do_cloneParent() throw(); - void do_cloneChild() throw(RuntimeException); + void do_cloneParent() ; + void do_cloneChild() noexcept(false); - static void notifyRelease(TimeEvent* timeEvent) throw(); - static TimeEvent* timeEvent(quantum_iterator& ii) throw() { return *ii; } + static void notifyRelease(TimeEvent* timeEvent) ; + static TimeEvent* timeEvent(quantum_iterator& ii) { return *ii; } friend class TickProducer; friend class TickConsumer;