Changed LICENSE. Now referenced to web site and file on project root directory
[anna.git] / source / timex / Engine.cpp
index bd8943e..22350a1 100644 (file)
@@ -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 //
 
 
 #include <algorithm>
@@ -62,10 +34,10 @@ using namespace anna::comm;
    Resolucion minima (en milisegundos) soportada por el controlador de tiempos.
 */
 //static
-const Millisecond timex::Engine::minResolution(100);
+const Millisecond anna::timex::Engine::minResolution(100);
 
 
-timex::Engine::Engine(const Millisecond & maxTimeout, const Millisecond & resolution) :
+anna::timex::Engine::Engine(const Millisecond & maxTimeout, const Millisecond & resolution) :
   app::Component(getClassName()),
   a_currentQuantum(0),
   a_maxQuantum(0),
@@ -79,7 +51,7 @@ timex::Engine::Engine(const Millisecond & maxTimeout, const Millisecond & resolu
   timex::sccs::activate();
 }
 
-timex::Engine::~Engine() {
+anna::timex::Engine::~Engine() {
   delete a_tickConsumer;
   delete [] a_timeTable;
 }
@@ -92,7 +64,7 @@ timex::Engine::~Engine() {
 //     posteriores ualarm vamos a calcular la diferencia entre el tiempo esperado y el momento
 //     en que realmente llega la seal de ualarm.
 //--------------------------------------------------------------------------------------------
-void timex::Engine::do_initialize()
+void anna::timex::Engine::do_initialize()
 throw(RuntimeException) {
   LOGMETHOD(TraceMethod tm("timex::Engine", "do_initialize", ANNA_FILE_LOCATION));
 
@@ -139,7 +111,7 @@ throw(RuntimeException) {
 }
 
 // Reimplementado de app::Component
-void timex::Engine::do_cloneParent()
+void anna::timex::Engine::do_cloneParent()
 throw() {
 }
 
@@ -147,7 +119,7 @@ throw() {
  * Se invoca desde app::Application::clone -> app::Component::do_cloneChild (ojo EN EL NUEVO PROCESO).
  * Instala la senhal de tick en el proceso, ya que la alarma no se hereda directamente.
  */
-void timex::Engine::do_cloneChild()
+void anna::timex::Engine::do_cloneChild()
 throw(RuntimeException) {
 }
 
@@ -155,7 +127,7 @@ throw(RuntimeException) {
 // No para los hilos de generacion, sino que evita que se escriban los bytes
 // en el 'pipe'.
 //----------------------------------------------------------------------------
-void timex::Engine::pause()
+void anna::timex::Engine::pause()
 throw(RuntimeException) {
   Guard guard(this, "timex::Engine (pause)");
 
@@ -169,7 +141,7 @@ throw(RuntimeException) {
   }
 }
 
-void timex::Engine::play()
+void anna::timex::Engine::play()
 throw(RuntimeException) {
   Guard guard(this, "timex::Engine (play)");
 
@@ -183,7 +155,7 @@ throw(RuntimeException) {
   }
 }
 
-void timex::Engine::activate(timex::TimeEvent* timeEvent)
+void anna::timex::Engine::activate(timex::TimeEvent* timeEvent)
 throw(RuntimeException) {
   LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "activate", ANNA_FILE_LOCATION));
 
@@ -252,7 +224,7 @@ throw(RuntimeException) {
   );
 }
 
-timex::TimeEvent* timex::Engine::getTimeEvent(const timex::TimeEvent::Id eventTimeId)
+anna::timex::TimeEvent* anna::timex::Engine::getTimeEvent(const timex::TimeEvent::Id eventTimeId)
 throw() {
   LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "getTimeEvent", ANNA_FILE_LOCATION));
   Directory::iterator iid;
@@ -276,7 +248,7 @@ throw() {
   return result;
 }
 
-void timex::Engine::cancel(timex::TimeEvent* timeEvent)
+void anna::timex::Engine::cancel(timex::TimeEvent* timeEvent)
 throw(RuntimeException) {
   LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "cancel", ANNA_FILE_LOCATION));
 
@@ -324,7 +296,7 @@ throw(RuntimeException) {
   notifyRelease(timeEvent);
 }
 
-void timex::Engine::do_stop()
+void anna::timex::Engine::do_stop()
 throw() {
   LOGMETHOD(TraceMethod tm("timex::Engine", "do_stop", ANNA_FILE_LOCATION));
   Quantum::iterator ii, maxii;
@@ -356,7 +328,7 @@ throw() {
   }
 }
 
-void timex::Engine::kill()
+void anna::timex::Engine::kill()
 throw() {
   Guard guard(this, "timex::Engine (kill)");
   app::functions::component <Communicator> (ANNA_FILE_LOCATION)->detach(a_tickConsumer);
@@ -385,7 +357,7 @@ throw() {
 //     del proceso, con lo que evita totalmente la posiblidad de perdida.
 // (3) Si el temporizador ha sido reactivado no tiene que liberarlo.
 //----------------------------------------------------------------------------------
-void timex::Engine::tick()
+void anna::timex::Engine::tick()
 throw(RuntimeException) {
   LOGMETHOD(TraceMethod tm(Logger::Local7, "timex::Engine", "tick", ANNA_FILE_LOCATION));
   /*
@@ -462,13 +434,13 @@ throw(RuntimeException) {
   eventEndQuantum(counter);
 }
 
-void timex::Engine::notifyRelease(timex::TimeEvent* timeEvent)
+void anna::timex::Engine::notifyRelease(timex::TimeEvent* timeEvent)
 throw() {
   if(timeEvent->a_observer != NULL)
     timeEvent->a_observer->release(timeEvent);
 }
 
-string timex::Engine::asString() const
+string anna::timex::Engine::asString() const
 throw() {
   string msg("timex::Engine { ");
   msg += app::Component::asString();
@@ -483,7 +455,7 @@ throw() {
   return msg += " }";
 }
 
-xml::Node* timex::Engine::asXML(xml::Node* parent) const
+xml::Node* anna::timex::Engine::asXML(xml::Node* parent) const
 throw() {
   parent = Component::asXML(parent);
   xml::Node* result = parent->createChild("timex.Engine");