release = ARGUMENTS.get ('release', 0)
# Environment
-env = Environment ()
+
+# Using clang, uncomment following:
+env = Environment(CXX = 'clang++')
+env.Append (CCFLAGS = '-DIS_CLANG')
+env.Append (CXXFLAGS = '-Wno-parentheses-equality')
+
+# Using c++, uncomment following:
+#env = Environment ()
+
#oracle_includes = os.environ["ORACLE_HOME"] + "/include"
oracle_includes = "/usr/lib/oracle/12.1/client64/include"
env.Append (VARIANT = variant)
else:
variant='debug'
- env.Append (CCFLAGS = '-g -O0 -D_DEBUG')
+ env.Append (CCFLAGS = '-g -O0')
env.Append (LIBPATH = os.path.join (current_directory, variant))
env.Append (VARIANT = variant)
+++ /dev/null
-Redmine server
-==============
-
-[Return to the project](http://redmine.teslayout.com/projects/anna-suite)
#include <anna/test/Response.hpp>
#include <anna/test/Request.hpp>
-class Sender : public timex::Clock {
+class Sender : public anna::timex::Clock {
public:
Sender () : Clock ("Sender", (Millisecond)1000),
a_messageBySecond (0),
private:
MyCommunicator a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
Sender a_sender;
Server* a_server;
{
CommandLine& commandLine (CommandLine::instantiate ());
- commandLine.add ("as", CommandLine::Argument::Optional, "Dirección broadcast en el que servidor atiende peticiones.");
+ commandLine.add ("as", CommandLine::Argument::Optional, "Direccion broadcast en el que servidor atiende peticiones.");
commandLine.add ("ps", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende las peticiones.");
- commandLine.add ("a", CommandLine::Argument::Optional, "Dirección broadcast en la que el cliente atiende respuestas.");
+ commandLine.add ("a", CommandLine::Argument::Optional, "Direccion broadcast en la que el cliente atiende respuestas.");
commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que atiende las respuestas");
activateGeneralPublicLicense ();
{
CommandLine& commandLine (CommandLine::instantiate ());
- commandLine.add ("as", CommandLine::Argument::Optional, "Dirección broadcast en el que servidor atiende peticiones.");
+ commandLine.add ("as", CommandLine::Argument::Optional, "Direccion broadcast en el que servidor atiende peticiones.");
commandLine.add ("ps", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende las peticiones.");
- commandLine.add ("ac", CommandLine::Argument::Optional, "Dirección broadcast en el que cliente atiende respuestas.");
+ commandLine.add ("ac", CommandLine::Argument::Optional, "Direccion broadcast en el que cliente atiende respuestas.");
commandLine.add ("pc", CommandLine::Argument::Mandatory, "Puerto al que enviar las respuestas");
commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)");
}
CommandLine& commandLine (CommandLine::instantiate ());
commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende respuestas.");
- commandLine.add ("a", CommandLine::Argument::Optional, "Dirección IP Puerto en el que el servidor atiende respuestas.");
+ commandLine.add ("a", CommandLine::Argument::Optional, "Direccion IP Puerto en el que el servidor atiende respuestas.");
commandLine.add ("host", CommandLine::Argument::Optional, "Nombre del host en el que atiende el servidor");
commandLine.add ("auto", CommandLine::Argument::Optional, "Autoreconexion", false);
commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)");
commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que atender peticiones");
commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP en la que atender");
commandLine.add ("d", CommandLine::Argument::Mandatory, "Retardo aplicado a la contestacio");
- commandLine.add ("maxpending", CommandLine::Argument::Optional, "Nº máximo de bytes en la cola de entrada");
+ commandLine.add ("maxpending", CommandLine::Argument::Optional, "Numero maximo de bytes en la cola de entrada");
commandLine.add ("limit", CommandLine::Argument::Mandatory, "% de ocupacion que permitimos");
- commandLine.add ("r", CommandLine::Argument::Optional, "Indicador de reuso de direccin", false);
+ commandLine.add ("r", CommandLine::Argument::Optional, "Indicador de reuso de direccion", false);
commandLine.add ("n", CommandLine::Argument::Optional, "Numero de mensajes a servir", true);
commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)");
commandLine.add ("clone", CommandLine::Argument::Optional, "Aplica el metodo de clonado en el tratamiento de mensajes", false);
- commandLine.add ("chunksize", CommandLine::Argument::Optional, "Tamaño del chunk de lectura");
+ commandLine.add ("chunksize", CommandLine::Argument::Optional, "Tamano del chunk de lectura");
}
//-----------------------------------------------------------------------------------------
#include <anna/test/Response.hpp>
#include <anna/test/Request.hpp>
-class Sender : public timex::Clock {
+class Sender : public anna::timex::Clock {
public:
Sender () : Clock ("Sender", (Millisecond)1000),
a_messageBySecond (0),
private:
MyCommunicator a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
Sender a_sender;
Service* a_service;
Communicator* communicator = anna::app::functions::component <Communicator> (ANNA_FILE_LOCATION);
if (a_messageBySecond == 0)
- throw RuntimeException ("Hay que indicar el nº de mensajes por segundo", ANNA_FILE_LOCATION);
+ throw RuntimeException ("Hay que indicar el numero de mensajes por segundo", ANNA_FILE_LOCATION);
if (a_errorCounter > 100) {
}
int main (int argc, const char** argv)
{
- timex::MicroMeter meter;
+ anna::timex::MicroMeter meter;
try {
Logger::setLevel (Logger::Debug);
Logger::Level level = Logger::getLevel ();
- for (register int i = 0; i < n; i ++) {
+ for (int i = 0; i < n; i ++) {
if ((i % 2) == 0)
Logger::write (level, "string", str.c_str (), ANNA_FILE_LOCATION);
else
+#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define STRING_SIZE 50
-#define INSERT_SAMPLE "insert into nemesis_db_test (xx, yy, zz, tt) values (?,?,?,?)"
+#define INSERT_SAMPLE "insert into anna_db_test (xx, yy, zz, tt) values (?,?,?,?)"
#define MAXCOLUMN 4
int main ()
{
if ((mysql = mysql_init (NULL)) == NULL)
- exit (-12);
+ exit(-12);
if (mysql_real_connect (mysql, NULL, "sdp", "sdp", "test", 0, NULL, 0L) == NULL) {
fprintf(stderr, " mysql_stmt_prepare(), SELECT failed\n");
exit(0);
}
+ return 0;
}
#define STRING_SIZE 50
-#define SELECT_SAMPLE "SELECT xx, yy, zz, tt FROM nemesis_db_test"
+#define SELECT_SAMPLE "SELECT xx, yy, zz, tt FROM anna_db_test"
#define MAXCOLUMN 4
cl.add ("user", CommandLine::Argument::Mandatory, "Nombre del usuario");
cl.add ("password", CommandLine::Argument::Mandatory, "Clave del usuario");
- cl.add ("host", CommandLine::Argument::Optional, "Nombre de la máquina donde se ubica el MySQL");
+ cl.add ("host", CommandLine::Argument::Optional, "Nombre de la maquina donde se ubica el MySQL");
cl.add ("db", CommandLine::Argument::Optional, "Nombre de la base de datos");
}
cl.add ("user", CommandLine::Argument::Mandatory, "Nombre del usuario");
cl.add ("password", CommandLine::Argument::Mandatory, "Clave del usuario");
- cl.add ("host", CommandLine::Argument::Optional, "Nombre de la máquina donde se ubica el MySQL");
+ cl.add ("host", CommandLine::Argument::Optional, "Nombre de la maquina donde se ubica el MySQL");
cl.add ("db", CommandLine::Argument::Optional, "Nombre de la base de datos");
}
CommandLine& cl (CommandLine::instantiate ());
cl.add ("dir", CommandLine::Argument::Mandatory, "Nombre del directorio a procesar");
- cl.add ("l", CommandLine::Argument::Optional, "Nº máximo de niveles de profundidad");
+ cl.add ("l", CommandLine::Argument::Optional, "Numero maximo de niveles de profundidad");
cl.add ("trace", CommandLine::Argument::Optional, "Nivel de trazado");
cl.add ("s", CommandLine::Argument::Mandatory, "Cache size");
}
{
TraceMethod tm ("WorkDirectory", "reuseHoles", ANNA_FILE_LOCATION);
- cout << "WorkDirectory::reuseHoles: Invoca dos veces a fullCache para verificar que el tamaño se mantiene la 2ª vez" << endl;
+ cout << "WorkDirectory::reuseHoles: Invoca dos veces a fullCache para verificar que el tamano se mantiene la segunda vez" << endl;
fullCache (dir, files, Flags::Clear);
fullCache (dir, files, Flags::Clear);
cout << endl;
{
TraceMethod tm ("WorkDirectory", "destroyObjects", ANNA_FILE_LOCATION);
- cout << "WorkDirectory::destroyObjects: Carga un directorio distinto, para verificar que destruye los objetos según se dejan de utilizar" << endl;
+ cout << "WorkDirectory::destroyObjects: Carga un directorio distinto, para verificar que destruye los objetos segun se dejan de utilizar" << endl;
filesystem::File* file;
filesystem::Directory* other = NULL;
}
a_burstActive = true;
- register int count;
+ int count;
for (count = 0; count < loadAmount; count++)
if (!sendBurstMessage()) break;
return -2;
}
- register int count;
+ int count;
for (count = 0; count < loadAmount; count++)
if (!sendBurstMessage(true /* anyway */)) break;
if (a_burstRepeat) {
a_burstCycle++;
- if (burstLogEnabled()) writeBurstLogFile(anna::functions::asString(("\nCompleted burst cycle. Starting again (repeat mode) on cycle %d.\n", a_burstCycle)));
+ if (burstLogEnabled()) writeBurstLogFile(anna::functions::asString("\nCompleted burst cycle. Starting again (repeat mode) on cycle %d.\n", a_burstCycle));
} else {
if (burstLogEnabled()) writeBurstLogFile("\nCompleted burst cycle. Burst finished (repeat mode disabled).\n");
#include <anna/test/Response.hpp>
#include <anna/test/Request.hpp>
-class Sender : public timex::Clock {
+class Sender : public anna::timex::Clock {
public:
Sender () : Clock ("Sender", (Millisecond)1000),
a_messageBySecond (0),
private:
MyCommunicator a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
Sender a_sender;
Server* a_server;
{
CommandLine& commandLine (CommandLine::instantiate ());
- commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende respuestas.");
- commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP Puerto en el que el servidor atiende respuestas.");
- commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la petición WIMS 2.0");
- commandLine.add ("op", CommandLine::Argument::Mandatory, "operación a realizar (sum,sub,mul,div)");
+ commandLine.add ("p", CommandLine::Argument::Mandatory, "Port to attend the answers.");
+ commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccion IP Puerto en el que el servidor atiende respuestas.");
+ commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la peticion WIMS 2.0");
+ commandLine.add ("op", CommandLine::Argument::Mandatory, "operacion a realizar (sum,sub,mul,div)");
commandLine.add ("x", CommandLine::Argument::Mandatory, "Primer operador");
commandLine.add ("y", CommandLine::Argument::Mandatory, "Segundo operador");
- commandLine.add ("op", CommandLine::Argument::Mandatory, "operación a realizar (sum,sub,mul,div)");
+ commandLine.add ("op", CommandLine::Argument::Mandatory, "operacion a realizar (sum,sub,mul,div)");
commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)");
- commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la petición WIMS 2.0");
- commandLine.add ("m", CommandLine::Argument::Optional, "Método HTTP a usar");
+ commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la peticion WIMS 2.0");
+ commandLine.add ("m", CommandLine::Argument::Optional, "Metodo HTTP a usar");
}
void IHTTPClient::initialize ()
CommandLine& commandLine (CommandLine::instantiate ());
commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que atender peticiones");
- commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP en la que atender");
+ commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccion IP en la que atender");
commandLine.add ("trace", CommandLine::Argument::Optional, "Nivel de trazas (debug,warning, error,...)");
- commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la petición WIMS 2.0");
- commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la petición WIMS 2.0");
+ commandLine.add ("domain", CommandLine::Argument::Mandatory, "Domain indicado en la peticion WIMS 2.0");
+ commandLine.add ("path", CommandLine::Argument::Optional, "Path indicado en la peticion WIMS 2.0");
}
void HTTPArithmeticServer::initialize ()
static const Millisecond Period(500);
static const Millisecond OneSecond(1000);
-class Sender : public timex::Clock {
+class Sender : public anna::timex::Clock {
public:
Sender () : Clock ("Sender", Period),
a_messageByTick (0),
private:
MyCommunicator a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
Sender a_sender;
Server* a_server;
http::wims20::ClientSide* a_request;
static const Millisecond Period(500);
static const Millisecond OneSecond(1000);
-class Sender : public timex::Clock {
+class Sender : public anna::timex::Clock {
public:
Sender ();
private:
MyCommunicator a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
Sender a_sender;
Server* a_server;
CommandLine& commandLine (CommandLine::instantiate ());
commandLine.add ("p", CommandLine::Argument::Mandatory, "Puerto en el que el servidor atiende respuestas.");
- commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccin IP Puerto en el que el servidor atiende respuestas.");
+ commandLine.add ("a", CommandLine::Argument::Mandatory, "Direccion IP Puerto en el que el servidor atiende respuestas.");
commandLine.add ("xml", CommandLine::Argument::Optional, "Documento XML que contiene la peticion");
commandLine.add ("nocheck", CommandLine::Argument::Optional, "Indicador para que no comprueba la validaded del HTML", false);
commandLine.add ("version", CommandLine::Argument::Optional, "Indica la version HTTP usada para enviar");
commandLine.add ("uri", CommandLine::Argument::Optional, "URI a usar");
- commandLine.add ("m", CommandLine::Argument::Optional, "Método HTTP a usar");
+ commandLine.add ("m", CommandLine::Argument::Optional, "Metodo HTTP a usar");
commandLine.add ("xmlresponse", CommandLine::Argument::Optional, "Visualiza la respuesta como un documento XML", false);
- commandLine.add ("overquota", CommandLine::Argument::Optional, "Nº de bytes a recibir sin identificar el protocolo");
+ commandLine.add ("overquota", CommandLine::Argument::Optional, "Numero de bytes a recibir sin identificar el protocolo");
commandLine.add ("c", CommandLine::Argument::Optional, "Valor de la cookie");
}
http::Method::Type::_v type = http::Method::Type::asEnum (cl.getValue ("m"));
if (type == http::Method::Type::None) {
- string msg ("Método HTTP no reconocido. ");
+ string msg ("Metodo HTTP no reconocido. ");
msg += http::Method::Type::asList ();
throw RuntimeException (msg, ANNA_FILE_LOCATION);
}
void MyCommunicator::eventBreakConnection (Server* server)
throw ()
{
- cout << "Perdida conexión con " << server->asString () << endl;
+ cout << "Perdida conexion con " << server->asString () << endl;
requestStop ();
}
}
Test::Test () :
- app::Application ("testfunctions", "Comprobación del sistema io", "1.0")
+ app::Application ("testfunctions", "Comprobacion del sistema io", "1.0")
{
CommandLine& commandLine (CommandLine::instantiate ());
commandLine.add ("file", CommandLine::Argument::Mandatory, "Nombre del fichero a procesar");
commandLine.add ("mode", CommandLine::Argument::Mandatory, "Modo (binary|text)");
- commandLine.add ("size", CommandLine::Argument::Mandatory, "Tamaño del buffer de entrada");
+ commandLine.add ("size", CommandLine::Argument::Mandatory, "Tamano del buffer de entrada");
}
void Test::initialize ()
private:
MyCommunicator a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
MyEngine a_ldapEngine;
Buddy a_buddy;
Stopper a_stopper;
cl.add ("scope", CommandLine::Argument::Optional, "Ambito");
cl.add ("user", CommandLine::Argument::Optional, "Usuario");
cl.add ("password", CommandLine::Argument::Optional, "Password");
- cl.add ("d", CommandLine::Argument::Optional, "Nivel de depuración (all = activa todo)");
+ cl.add ("d", CommandLine::Argument::Optional, "Nivel de depuracion (all = activa todo)");
}
//-----------------------------------------------------------------------------------------
private:
comm::Communicator* a_communicator;
- timex::Engine a_timeController;
+ anna::timex::Engine a_timeController;
http4comm::Context* a_context;
comm::ReceiverFactoryImpl <Acceptor> a_acceptorFactory;
using namespace anna;
using namespace test;
-http4comm::Context::Context (timex::Engine& timeController, const Millisecond& timeout) :
- timex::Context<S64> ("http4comm", timeController, timeout)
+http4comm::Context::Context (anna::timex::Engine& timeController, const Millisecond& timeout) :
+ anna::timex::Context<S64> ("http4comm", timeController, timeout)
{;}
void http4comm::Context::create (const S64 id, comm::ClientSocket& clientSocket)
throw (RuntimeException)
{
- http4comm::Transaction* transaction = static_cast <http4comm::Transaction*> (timex::Context <S64>::open (id, 0));
+ http4comm::Transaction* transaction = static_cast <http4comm::Transaction*> (anna::timex::Context <S64>::open (id, 0));
transaction->setClientSocket (&clientSocket);
* Si el fuera necesaria la instancia de una transación y no hay ninguna otra marcada como "no-usada" se
* crearía una nueva instancia.
*/
-timex::Transaction* http4comm::Context::createTransaction (const int /*classType*/)
+anna::timex::Transaction* http4comm::Context::createTransaction (const int /*classType*/)
throw ()
{
// Si nuestra aplicación tratara más de un tipo de transación tendríamos que obtenerla de
/**
* Cuando la instancia dela transación no se esté usando se marca como no-usada.
*/
-void http4comm::Context::releaseTransaction (timex::Transaction* tt)
+void http4comm::Context::releaseTransaction (anna::timex::Transaction* tt)
throw ()
{
// Si nuestra aplicación tratata más de un tipo tendríamos que obtener el tipo
using namespace anna;
-class Context : public timex::Context <S64> {
+class Context : public anna::timex::Context <S64> {
public:
- Context (timex::Engine&, const Millisecond& timeout);
+ Context (anna::timex::Engine&, const Millisecond& timeout);
void create (const S64 id, comm::ClientSocket&) throw (RuntimeException);
void destroy (Transaction*) throw ();
private:
Recycler <Transaction> a_transactions;
- timex::Transaction* createTransaction (const int /*classType*/) throw ();
- void releaseTransaction (timex::Transaction* tt) throw ();
+ anna::timex::Transaction* createTransaction (const int /*classType*/) throw ();
+ void releaseTransaction (anna::timex::Transaction* tt) throw ();
std::string identifierAsString (const S64&) const throw ();
const S64& contextAsIdentifier (const void*) const throw ();
* Si el servidor aritmético no contesta antes de que se cumpla el tiempo de espera
* de la transación se contesta al cliente con un error indicando la situación.
*/
-void http4comm::Transaction::expire (timex::Engine*)
+void http4comm::Transaction::expire (anna::timex::Engine*)
throw (RuntimeException)
{
comm::Communicator* communicator = app::functions::component <comm::Communicator> (ANNA_FILE_LOCATION);
using namespace anna;
-class Transaction : public timex::Transaction {
+class Transaction : public anna::timex::Transaction {
public:
Transaction ();
comm::ClientSocket* a_clientSocket;
http::Response* a_httpResponse;
- void expire (timex::Engine*) throw (RuntimeException);
+ void expire (anna::timex::Engine*) throw (RuntimeException);
};
}
#define anna_strchr(a,b) strchr((a),(b))
#endif
-#define anna_signal_shield(r,a) { register int cx (0); do { if ((r = (a)) < 0) cx ++; } while (r < 0 && errno == EINTR && cx < 5); }
+#define anna_signal_shield(r,a) { int cx (0); do { if ((r = (a)) < 0) cx ++; } while (r < 0 && errno == EINTR && cx < 5); }
//#define anna_append_string(str,str1,str2) (str).append (str1).append (str2)
static const char* asNotNullCString (const _v v) throw () { return (v != None) ? literal [v]: "<none>"; } \
static std::string asList () throw () {\
std::string result;\
- for (register int ii = 0; literal [ii] != NULL; ii ++) { \
+ for (int ii = 0; literal [ii] != NULL; ii ++) { \
if (ii == 0 && strcmp (literal [ii], "None") == 0) continue; \
if (ii > 1) result += ' '; \
result += "'"; result += literal [ii]; result += "'"; \
* \return el número de bits necesarios para representar el valor recibido como parámetro.
*/
static int bitsize(const S64 n) throw() {
- register int aux = n >> intBitSize;
+ int aux = n >> intBitSize;
return (aux != 0) ? (bitsize(aux) + intBitSize) : bitsize((int) n);
}
* @param alarmType Alarm enum-identification within the own context/module
* @param ... Optional parsing data for dynamic-composed text.
*/
- void activateAlarm(const int & type, ...) const throw(anna::RuntimeException);
+ void activateAlarm(int type, ...) const throw(anna::RuntimeException);
/**
* @param alarmType Alarm enum-identification within the own context/module
* @param ... Optional parsing data for dynamic-composed text.
*/
- void cancelAlarm(const int & type, ...) const throw(anna::RuntimeException);
+ void cancelAlarm(int type, ...) const throw(anna::RuntimeException);
/**
private:
typedef std::map <Index, Instance*>::value_type value_type;
- struct Instance;
-
friend class Holes;
class Holes {
// set
void initialize(const Dictionary *d = NULL) throw() { _initialize(d); }
void setCode(const U24 & c) throw(anna::RuntimeException) {
- if(c < 0) throw anna::RuntimeException("Negative command-code not allowed", ANNA_FILE_LOCATION);
a_id.first = c;
}
--- /dev/null
+// This is a Workaround for clang
+// See more at: http://reviews.llvm.org/rL201729 and http://gcc.gnu.org/gcc-4.9/porting_to.html (cstddef changes)
+// This file and its references should be removed when upgraded clang resources
+
+#ifndef anna_test_Request_hpp
+#define anna_test_Request_hpp
+
+#if IS_CLANG && ( __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L )
+typedef struct {
+ long long __clang_max_align_nonce1
+ __attribute__((__aligned__(__alignof__(long long))));
+ long double __clang_max_align_nonce2
+ __attribute__((__aligned__(__alignof__(long double))));
+} max_align_t;
+#define __CLANG_MAX_ALIGN_T_DEFINED
+#endif
+
+#endif
case Handler::Type::Custom:
result = NULL;
break;
+ default: break;
}
}
if(variable == NULL)
throw RuntimeException(functions::asString("Id %d is not defined", id), ANNA_FILE_LOCATION);
- switch(variable->isNull()) {
- case true:
-
+ if(variable->isNull()) {
if(isNull == false) a_nullCounter --;
-
- break;
- case false:
-
+ }
+ else {
if(isNull == true) a_nullCounter ++;
-
- break;
}
variable->setNull(isNull);
void comm::CompatCodec::setNull(const comm::Variable* variable, const bool isNull)
throw() {
- switch(variable->isNull()) {
- case true:
-
+ if(variable->isNull()) {
if(isNull == false) a_nullCounter --;
-
- break;
- case false:
-
+ }
+ else {
if(isNull == true) a_nullCounter ++;
-
- break;
}
const_cast <comm::Variable*>(variable)->setNull(isNull);
//-----------------------------------------------------------------------
const DataBlock& comm::CompatCodec::code()
throw(RuntimeException) {
- register unsigned char c(0);
+ unsigned char c(0);
iterator ii;
iterator maxii(a_variables.end());
- register Variable* variable;
+ Variable* variable;
int stringLen;
const char* string;
char aux [sizeof(S64)];
self += codec;
}
break;
+ default: break;
}
}
char* data = const_cast <char*>(self.getData());
int size = self.getSize();
- for(register int i = 1, key = data [0]; i < size; i ++)
+ for(int i = 1, key = data [0]; i < size; i ++)
data [i] ^= key ++;
}
throw RuntimeException("Can not decode an empty DataBlock", ANNA_FILE_LOCATION);
if(data [0] != 0)
- for(register int i = 1, key(data [0]); i < size; i ++)
+ for(int i = 1, key(data [0]); i < size; i ++)
const_cast <char*>(data)[i] ^= key ++;
LOGDEBUG(Logger::write(Logger::Debug, "comm::CompatCodec::decode", dataBlock, ANNA_FILE_LOCATION));
comm::Variable* comm::CompatCodec::VariableContainer::find(const int id)
throw() {
- for(register int ii = 0; ii < a_size; ii ++) {
+ for(int ii = 0; ii < a_size; ii ++) {
if(a_variables [ii]->getId() == id)
return a_variables [ii];
}
const comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) const
throw() {
- for(register int ii = 0; ii < a_size; ii ++) {
+ for(int ii = 0; ii < a_size; ii ++) {
if(a_variables [ii]->getId() == id)
return a_variables [ii];
}
case Handler::Type::ClientSocket:
a_clientSockets.release(static_cast <ClientSocket*>(handler));
break;
+ default: break;
}
}
if((a_size + len) >= a_maxSize) extend(len);
- register char* w = a_buffer + a_size;
+ char* w = a_buffer + a_size;
switch(len) {
case 0: break;
int aux;
int j = 0;
- for(register int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) {
+ for(int ii = 1, maxii = hexString.length(); ii < maxii; ii += 2) {
if(isxdigit(aux = src [ii - 1]) == 0)
throw RuntimeException("Invalid HexString", ANNA_FILE_LOCATION);
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
};
int r = -1; // r will be lg(v)
- register unsigned int t, tt; // temporaries
+ unsigned int t, tt; // temporaries
if(tt = v >> 16) {
r = (t = tt >> 8) ? 24 + LogTable256[t] : 16 + LogTable256[tt];
}
if((mode == TextJustifyMode::Right) || (mode == TextJustifyMode::Center)) {
- for(register int k = 0; k < (repeat + (adjust ? 1 : 0)); k++) result += filler;
+ for(int k = 0; k < (repeat + (adjust ? 1 : 0)); k++) result += filler;
result += " ";
}
if((mode == TextJustifyMode::Left) || (mode == TextJustifyMode::Center)) {
result += " ";
- for(register int k = 0; k < repeat; k++) result += filler;
+ for(int k = 0; k < repeat; k++) result += filler;
}
return result;
}
if((mode == TextHighlightMode::Leftline) || (mode == TextHighlightMode::LeftAndRightline)) {
- for(register int k = 0; k < (lr_repeat + (adjust ? 1 : 0)); k++) result += filler;
+ for(int k = 0; k < (lr_repeat + (adjust ? 1 : 0)); k++) result += filler;
result += " ";
}
if((mode == TextHighlightMode::Overline) || (mode == TextHighlightMode::OverAndUnderline)) {
- for(register int k = 0; k < ou_repeat; k++) result += filler;
+ for(int k = 0; k < ou_repeat; k++) result += filler;
result += "\n";
}
if((mode == TextHighlightMode::Underline) || (mode == TextHighlightMode::OverAndUnderline)) {
result += "\n";
- for(register int k = 0; k < ou_repeat; k++) result += filler;
+ for(int k = 0; k < ou_repeat; k++) result += filler;
}
if((mode == TextHighlightMode::Rightline) || (mode == TextHighlightMode::LeftAndRightline)) {
result += " ";
- for(register int k = 0; k < lr_repeat; k++) result += filler;
+ for(int k = 0; k < lr_repeat; k++) result += filler;
}
if(appendCR) result += "\n";
size_t pos, from = 0;
std::string tab, crTab = "\n";
- for(register int k = 0; k < tabSpaces; k++) tab += " ";
+ for(int k = 0; k < tabSpaces; k++) tab += " ";
crTab += tab;
result = tab;
return result;
}
- for(register int k = 0; k < size; k ++) {
+ for(int k = 0; k < size; k ++) {
unsigned char c = (unsigned char) buffer [k];
int printable = isprint(c);
result += (printable ? (char) c : '.');
char rByte[3]; // readable byte
rByte[2] = 0;
- for(register int k = 0; k < length; k += 2) {
+ for(int k = 0; k < length; k += 2) {
rByte[0] = rawPresentation[k];
rByte[1] = rawPresentation[k + 1];
sscanf(rByte, "%x", &byte);
char rByte[3]; // readable byte
rByte[2] = 0;
- for(register int k = 0; k < length; k++) {
+ for(int k = 0; k < length; k++) {
byte = (unsigned char)db[k];
sprintf(rByte, "%.2X", byte);
result += rByte;
// La expresión regular no controla si hay mas de 3 puntos:
int n_dot = 0;
- for(register int k = 0; k < ip.length(); k++)
+ for(int k = 0; k < ip.length(); k++)
if(ip[k] == '.') n_dot++;
if(n_dot > 3)
bool functions::isIPv6(const std::string & ip) throw() {
// Chequeo de digitos permitidos:
- for(register int k = 0; k < ip.length(); k++) {
+ for(int k = 0; k < ip.length(); k++) {
bool digit = isdigit(ip[k]);
bool hex = ((ip[k] == 'a') ||
(ip[k] == 'b') ||
// Number of ocurrences for '.'
int n_dot = 0;
- for(register int k = 0; k < pureIPv4.length(); k++)
+ for(int k = 0; k < pureIPv4.length(); k++)
if(pureIPv4[k] == '.') n_dot++;
if(n_dot > 3)
// Number of ocurrences for ':'
int n_colon = 0;
- for(register int k = 0; k < result.length(); k++)
+ for(int k = 0; k < result.length(); k++)
if(result[k] == ':') n_colon++;
// Generate equivalent to '::'
std::string equiv_str;
- for(register int k = 0; k < (8 - n_colon); k++)
+ for(int k = 0; k < (8 - n_colon); k++)
equiv_str += ":0";
equiv_str += ":";
// Protection: it must be seven colons:
int n_colon = 0;
- for(register int k = 0; k < result.length(); k++)
+ for(int k = 0; k < result.length(); k++)
if(result[k] == ':') n_colon++;
if(n_colon != 7)
result.erase(lastPos, 1);
// Chequeo de digitos permitidos:
- for(register int k = 0; k < result.length(); k++) {
+ for(int k = 0; k < result.length(); k++) {
bool digit = isdigit(result[k]);
bool hex = ((result[k] == 'a') ||
(result[k] == 'b') ||
const char* functions::codeInteger(char* result, const int n)
throw() {
int aux(htonl(n));
- register char* w((char*) &aux);
+ char* w((char*) &aux);
*result = *w;
*(result + 1) = *(w + 1);
*(result + 2) = *(w + 2);
const char* functions::codeShort(char* result, const short int n)
throw() {
short int aux(htons(n));
- register char* w((char*) &aux);
+ char* w((char*) &aux);
*result = *w;
*(result + 1) = *(w + 1);
return result;
int functions::decodeInteger(const char* data)
throw() {
int result;
- register char* w((char*) &result);
+ char* w((char*) &result);
*w = *data;
*(w + 1) = *(data + 1);
*(w + 2) = *(data + 2);
short int functions::decodeShort(const char* data)
throw() {
short int result;
- register char* w((char*) &result);
+ char* w((char*) &result);
*w = *data;
*(w + 1) = *(data + 1);
return ntohs(result);
isupNumber.Digits = "";
int byte;
- for(register int k = 2; k < length; k ++) {
+ for(int k = 2; k < length; k ++) {
byte = (buffer [k] & 0x0f);
isupNumber.Digits += (byte >= 0 && byte <= 9) ? (byte + '0') : ((byte - 0xa) + 'a');
byte = (buffer [k] & 0xf0) >> 4;
//std::transform(dtlc.begin(), dtlc.end(), dtlc.begin(), std::tolower);
const char *digits = dtlc.c_str();
- for(register int k = 1; k < isupNumber.Digits.size(); k += 2) {
+ for(int k = 1; k < isupNumber.Digits.size(); k += 2) {
if(isxdigit(byte = digits [k - 1]) == 0)
throw anna::RuntimeException("functions::codeIsupNumber | Isup number 'Digits' field contains invalid digits (non hexadecimal)", ANNA_FILE_LOCATION);
result = Recycler <Thread>::create();
break;
+ default: break;
}
result->a_manager = this;
//------------------------------------------------------------------------------
//------------------------------------------------------ Module::activateAlarm()
//------------------------------------------------------------------------------
-void anna::oam::Module::activateAlarm(const int & type, ...) const throw(anna::RuntimeException) {
+void anna::oam::Module::activateAlarm(int type, ...) const throw(anna::RuntimeException) {
// LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "activateAlarm", ANNA_FILE_LOCATION));
// Checkings
//------------------------------------------------------------------------------
//-------------------------------------------------------- Module::cancelAlarm()
//------------------------------------------------------------------------------
-void anna::oam::Module::cancelAlarm(const int & type, ...) const throw(anna::RuntimeException) {
+void anna::oam::Module::cancelAlarm(int type, ...) const throw(anna::RuntimeException) {
// LOGMETHOD(anna::TraceMethod tttm("anna::oam::Module", "cancelAlarm", ANNA_FILE_LOCATION));
// Checkings
Guard csGuard(cscope, "oam::CounterScope from oam::Module::record");
- for(register int icounter = 0; icounter < CounterScope::MaxCounter; icounter ++) {
+ for(int icounter = 0; icounter < CounterScope::MaxCounter; icounter ++) {
Counter* counter = cscope->a_counters [icounter];
if(counter == NULL)
}
// Update a_data:
- for(register unsigned int k = min; k <= max; k++) {
+ for(unsigned int k = min; k <= max; k++) {
a_data[k] = 0;
if(k == UINT_MAX/* overflow */) break;
buffer.allocate(a_expression.length() + 32);
sprintf((char*) buffer.getData(), a_expression.c_str(), getFloatValue());
break;
+ default: break;
}
return buffer.getData();
case Type::Float: a_value.a_float = &a_aux.theFloat; break;
case Type::Double: a_value.a_double = &a_aux.theDouble; break;
case Type::Custom: a_value.a_custom = NULL; break;
+ default: break;
}
}
delete a_value.a_dataBlock;
a_value.a_dataBlock = NULL;
break;
+ default: break;
}
}
switch(a_type) {
case Type::Integer: result = *a_value.a_integer; break;
case Type::Integer64: result = *a_value.a_longInteger; break;
+ default: break;
}
return result;
switch(a_type) {
case Type::Float: result = *a_value.a_float; break;
case Type::Double: result = (float) *a_value.a_double; break;
+ default: break;
}
return result;
switch(a_type) {
case Type::Float: result = (double) *a_value.a_float; break;
case Type::Double: result = *a_value.a_double; break;
+ default: break;
}
return result;
case Type::Float: result += functions::asString("%f", *a_value.a_float); break;
case Type::Double: result += functions::asString("%g", *a_value.a_double); break;
case Type::Custom: result += functions::asHexString(anna_ptrnumber_cast(a_value.a_custom)); break;
+ default: break;
}
}
case Type::Float: result = a_value.a_float; break;
case Type::Double: result = a_value.a_double; break;
case Type::Custom: result = a_value.a_custom; break;
+ default: break;
}
return result;
case Type::Float: result = a_value.a_float; break;
case Type::Double: result = a_value.a_double; break;
case Type::Custom: result = a_value.a_custom; break;
+ default: break;
}
return result;
DataBlock::allocate(maxSize);
char* buffer = (char*) DataBlock::getData();
int aux = htonl(originalSize);
- register char* w((char*) &aux);
+ char* w((char*) &aux);
/* Establece el tamaño original del buffer */
buffer [0] = *w;
buffer [1] = *(w + 1);
char* buffer = (char*) zdata.getData();
int aux;
uLong size;
- register char* w((char*) &aux);
+ char* w((char*) &aux);
*w = *buffer;
*(w + 1) = *(buffer + 1);
*(w + 2) = *(buffer + 2);
case Data::Type::TimeStamp:
a_time = new MYSQL_TIME;
break;
+ default: break;
}
}
a_ofb = new anna::DataBlock(true);
a_ofb->allocate(2048); // (1)
break;
+ default: break;
}
}
char* dest = const_cast <char*>(a_ofb->getData());
- register int j = 0;
+ int j = 0;
- for(register int i = 0; i < length; i ++) {
+ for(int i = 0; i < length; i ++) {
dest [j ++] = asCharacter((src [i] & 0xf0) >> 4);
dest [j ++] = asCharacter(src [i] & 0x0f);
}
int j = 0;
- for(register int i = 1; i < a_length; i += 2, j ++) {
+ for(int i = 1; i < a_length; i += 2, j ++) {
hex = asByte(src [i - 1]) << 4;
hex |= asByte(src [i]);
dest [j] = hex;
do {
w = connection(a_iiConnection);
- a_iiConnection;
if(a_iiConnection == maxii)
a_iiConnection = begin();
if(str == NULL || (len = anna_strlen(str)) == 0)
return str;
- register int end = len - 1;
+ int end = len - 1;
while(end >= 0 && str [end] == ' ') end --;
a_maxSize = std::min(8U, std::max(256U, maxSize >> 7));
a_instances = new Instance [a_maxSize];
- for(register int i = 0; i < a_maxSize; i ++)
+ for(int i = 0; i < a_maxSize; i ++)
a_instances [i].object = (*objectAllocator)();
}
result->a_engine = this;
result->initializeStatisticConcepts();
- for(register int k = 0; k < a_numberOfClientSessionsPerServer; k++)
+ for(int k = 0; k < a_numberOfClientSessionsPerServer; k++)
result->addClientSession(k);
a_servers.insert(server_value_type(socket, result));
// Balance
if(balance) {
- for(register int k = 0; k < getMaxServers(); k++) { // try round-robin only over one cycle,
+ for(int k = 0; k < getMaxServers(); k++) { // try round-robin only over one cycle,
// no matter where you are: don't repeat same server
if(a_deliveryIterator == end()) a_deliveryIterator = begin();
bool fixedSocket = (socketId != -1);
int clientSessions = getNumberOfClientSessions();
- for(register int k = 0; k < clientSessions; k++) { // try round-robin only over one cycle,
+ for(int k = 0; k < clientSessions; k++) { // try round-robin only over one cycle,
// no matter where you are: don't repeat same socket
if(fixedSocket)
a_lastUsedResource = a_engine->findClientSession(a_socket.first /*ip*/, a_socket.second /*port*/, socketId); // exception if not found
}
avp_it++;
- // (*) for (register int k = 0; k < (*rule_it).second.getQualMax(); k++) avp_it++
+ // (*) for (int k = 0; k < (*rule_it).second.getQualMax(); k++) avp_it++
} else
okFixed = false;
// Application-id
u_aux = appid->getIntegerValue();
+ /*
if(u_aux < 0) {
std::string msg = "Error processing command <application-id '"; msg += appid->getValue();
msg += "': negative values are not allowed";
throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
}
+ */
setApplicationId(u_aux);
if(hbh) {
u_aux = hbh->getIntegerValue();
+ /*
if(u_aux < 0) {
std::string msg = "Error processing command <hop-by-hop-id '"; msg += hbh->getValue();
msg += "': negative values are not allowed";
throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
}
+ */
} else u_aux = 0;
setHopByHop(u_aux);
if(ete) {
u_aux = ete->getIntegerValue();
+ /*
if(u_aux < 0) {
std::string msg = "Error processing command <end-to-end-id '"; msg += ete->getValue();
msg += "': negative values are not allowed";
throw anna::RuntimeException(msg, ANNA_FILE_LOCATION);
}
+ */
} else u_aux = 0;
setEndToEnd(u_aux);
std::string qual = (*it).second.getQual();
int NumberOfSpaces = strlen(DICTIONARY_AVPRULE_TAB) - qual.size();
- for(register int k = 0; k < NumberOfSpaces; k++) trace += " ";
+ for(int k = 0; k < NumberOfSpaces; k++) trace += " ";
trace += (*it).second.asString();
trace += "\n";
/* max expected avp description size */ 48 -
/* current trace length */ trace.size();
- for(register int k = 0; k < NumberOfDots; k++) trace += ".";
+ for(int k = 0; k < NumberOfDots; k++) trace += ".";
trace += anna::diameter::functions::avpIdAsPairString(avp->getId());
}
std::string qual = (*it).second.getQual();
int NumberOfSpaces = strlen(DICTIONARY_AVPRULE_TAB) - qual.size();
- for(register int k = 0; k < NumberOfSpaces; k++) trace += " ";
+ for(int k = 0; k < NumberOfSpaces; k++) trace += " ";
trace += (*it).second.asString();
trace += "\n";
throw anna::RuntimeException(s_ex, ANNA_FILE_LOCATION);
}
- const Format * found;
-
- if(found = getFormat(format.getName())) {
+ const Format * found = getFormat(format.getName());
+ if(found) {
if(!a_allowUpdates) {
std::string s_ex = "Cannot add a format with an existing type name: ";
//s_ex += format.getName();
//------------------------------------------------------ Dictionary::addVendor()
//------------------------------------------------------------------------------
void Dictionary::addVendor(const Vendor & vendor) throw(anna::RuntimeException) {
- const Vendor * found;
- if(found = getVendor(vendor.getId())) {
+ const Vendor * found = getVendor(vendor.getId());
+ if(found) {
if(!a_allowUpdates) {
std::string s_ex = "Cannot add a vendor with an existing code: ";
s_ex += vendor.asString();
ITEM_OVERWRITE("vendor", vendor, a_vendors, a_vendorNames);
}
- if(found = getVendor(vendor.getName())) {
+ found = getVendor(vendor.getName());
+ if(found) {
if(!a_allowUpdates) {
std::string s_ex = "Cannot add a vendor with an existing name: ";
s_ex += vendor.asString();
//--------------------------------------------------------- Dictionary::addAvp()
//------------------------------------------------------------------------------
void Dictionary::addAvp(const Avp & avp) throw(anna::RuntimeException) {
- const Avp * found;
- if(found = getAvp(avp.getId())) {
+ const Avp * found = getAvp(avp.getId());
+ if (found) {
if(!a_allowUpdates) {
std::string s_ex = "Cannot add an avp with an existing identifier (code,vendor):\n";
s_ex += avp.asString();
//----------------------------------------------------- Dictionary::addCommand()
//------------------------------------------------------------------------------
void Dictionary::addCommand(const Command & command) throw(anna::RuntimeException) {
- const Command * found;
-
- if(found = getCommand(command.getId())) {
+
+ const Command * found = getCommand(command.getId());
+ if(found) {
if(!a_allowUpdates) {
std::string s_ex = "Cannot add a command with an existing identifier (code,request):\n";
s_ex += command.asString();
ITEM_OVERWRITE("command", command, a_commands, a_commandNames);
}
- if(found = getCommand(command.getName())) {
+
+ found = getCommand(command.getName());
+ if(found) {
if(!a_allowUpdates) {
std::string s_ex = "Cannot add a command with an existing name:\n";
s_ex += command.asString();
_xmlDoc* html::DocumentFile::do_initialize(const anna::DataBlock&)
throw(RuntimeException) {
- throw("html::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION);
+ throw RuntimeException("html::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION);
return NULL;
}
_xmlDoc* html::DocumentMemory::do_initialize(const anna::DataBlock& contain)
throw(RuntimeException) {
- throw("html::DocumentMemory::do_initialize | Not implemented", ANNA_FILE_LOCATION);
+ throw RuntimeException("html::DocumentMemory::do_initialize | Not implemented", ANNA_FILE_LOCATION);
return NULL;
}
http::Method::Type::_v http::Method::asType(const http::Token* token)
throw() {
- for(register int ii = 0; anna_item_enum(http::Method::Type, ii) != NULL; ii ++) {
+ for(int ii = 0; anna_item_enum(http::Method::Type, ii) != NULL; ii ++) {
if(token->match(anna_item_enum(http::Method::Type, ii)) == true)
return (Type::_v) ii;
}
bool http::Token::contains(const char byte) const
throw() {
- register const char* p;
- register const char* maxp;
+ const char* p;
+ const char* maxp;
for(p = DataBlock::getData(), maxp = p + DataBlock::getSize(); p < maxp; p ++) {
if(*p == byte)
int http::Tokenizer::find(const char* data, const int size, const char searched)
throw() {
- for(register int i = 0; i < size; i ++, data ++) {
+ for(int i = 0; i < size; i ++, data ++) {
if(*data == searched)
return i;
}
{
switch (a_status) {
case 0:
- cout << "Elija operación [+|-|*|/|q = quit]: " << flush;
+ cout << "Elija operacion [+|-|*|/|q = quit]: " << flush;
break;
case 1:
cout << "Indique primer operador: " << flush;
using namespace anna;
-timex::Clock::Clock(const char* name, const Millisecond & timeout) :
+anna::timex::Clock::Clock(const char* name, const Millisecond & timeout) :
TimeEvent(anna_ptrnumber_cast(this), timeout),
a_name(name) {
}
-void timex::Clock::expire(timex::Engine* timeController)
+void anna::timex::Clock::expire(timex::Engine* timeController)
throw(RuntimeException) {
bool moreTick = true;
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),
timex::sccs::activate();
}
-timex::Engine::~Engine() {
+anna::timex::Engine::~Engine() {
delete a_tickConsumer;
delete [] a_timeTable;
}
// 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));
}
// Reimplementado de app::Component
-void timex::Engine::do_cloneParent()
+void anna::timex::Engine::do_cloneParent()
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) {
}
// 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)");
}
}
-void timex::Engine::play()
+void anna::timex::Engine::play()
throw(RuntimeException) {
Guard guard(this, "timex::Engine (play)");
}
}
-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));
);
}
-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;
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));
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;
}
}
-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);
// 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));
/*
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();
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");
using namespace anna;
-timex::TimeEvent::~TimeEvent() {
+anna::timex::TimeEvent::~TimeEvent() {
if(a_controller != NULL) {
try {
a_controller->cancel(this);
}
}
-std::string timex::TimeEvent::asString() const
+std::string anna::timex::TimeEvent::asString() const
throw() {
std::string result("timex::TimeEvent { Id: ");
result += functions::asHexString(a_id);
// se llenaba.
// (2) Puede ser que se invoque mas de una vez.
//--------------------------------------------------------------------------------------------
-void timex::TickConsumer::initialize()
+void anna::timex::TickConsumer::initialize()
throw(RuntimeException) {
if(a_pipe [0] != -1) // (2)
return;
setfd(a_pipe [0]);
}
-void timex::TickConsumer::apply()
+void anna::timex::TickConsumer::apply()
throw(RuntimeException) {
char buffer [256];
}
}
-void timex::TickConsumer::finalize()
+void anna::timex::TickConsumer::finalize()
throw() {
if(a_timeController.a_tickProducer)
a_timeController.a_tickProducer->requestStop();
* Asi que cada proceso debe tener su propia copia del pipe, para que cada uno lleve independientemente
* el control de tiempos.
*/
-void timex::TickConsumer::clone()
+void anna::timex::TickConsumer::clone()
throw(RuntimeException) {
close(a_pipe [0]);
close(a_pipe [1]);
a_timeController.a_tickProducer->setfd(a_pipe [1]);
}
-std::string timex::TickConsumer::asString() const
+std::string anna::timex::TickConsumer::asString() const
throw() {
string result("timex::TickConsumer { ");
result += Handler::asString();
using namespace anna;
//static
-void* timex::TickProducer::exec(void* arg)
+void* anna::timex::TickProducer::exec(void* arg)
throw() {
sigset_t mask;
sigemptyset(&mask);
return NULL;
}
-timex::TickProducer::TickProducer(timex::Engine* timeController, const int fdWrite) :
+anna::timex::TickProducer::TickProducer(timex::Engine* timeController, const int fdWrite) :
a_timeController(*timeController),
a_fdWrite(fdWrite),
a_expectedTime(0),
a_requestedStop(false)
{;}
-void timex::TickProducer::tick()
+void anna::timex::TickProducer::tick()
throw() {
static char onebyte = 0xff;
static int errorCount = 0;
// (3) Si la correcin aplicada es mayor del 5% de la resolucin volvemos a calcularla ya
// que podemos considerar que normalmente no desviar�tanto tiempo.
//--------------------------------------------------------------------------------------------
-Millisecond timex::TickProducer::calculeSlice(const Millisecond & msnow)
+Millisecond anna::timex::TickProducer::calculeSlice(const Millisecond & msnow)
throw() {
Millisecond result(a_timeController.getResolution());
int correction = (a_expectedTime == 0) ? 0 : (a_expectedTime - msnow); // (2)
_xmlDoc* DocumentFile::do_initialize(const anna::DataBlock&)
throw(RuntimeException) {
- throw("xml::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION);
+ throw RuntimeException("xml::DocumentFile::do_initialize | Not implemented", ANNA_FILE_LOCATION);
return NULL;
}
const char* w;
while(xmlNode != NULL) {
- switch(xmlNode->type) {
- case XML_ELEMENT_NODE:
+
+ if((xmlNode->type) == XML_ELEMENT_NODE) {
child = node->createChild((const char*) xmlNode->name);
for(xmlNs* ns = xmlNode->nsDef; ns != NULL; ns = ns->next)
attributes(child, xmlNode->properties);
children(child, xmlNode->children);
- break;
- case XML_TEXT_NODE:
+ }
+ else if((xmlNode->type) == XML_TEXT_NODE) {
w = (const char*) xmlNode->content;
isSeparator = true;
isSeparator = false;
break;
}
-
w ++;
}
if(isSeparator == false)
node->createText(decode(xmlNode->content));
-
- break;
}
+
xmlNode = xmlNode->next;
}
}
#define BOOST_TEST_MODULE ANNA_CONFIG_TEST
+#include <anna/test/clang_specific.hpp>
#include <boost/test/included/unit_test.hpp>
#include <iostream>
#define BOOST_TEST_MODULE ANNA_CORE_TEST
+#include <anna/test/clang_specific.hpp>
#include <boost/test/included/unit_test.hpp>
#include <iostream>
#define BOOST_TEST_MODULE ANNA_TIME_TEST
+#include <anna/test/clang_specific.hpp>
#include <boost/test/included/unit_test.hpp>
//#include <iostream>