X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=source%2Fcomm%2FCompatCodec.cpp;fp=source%2Fcomm%2FCompatCodec.cpp;h=39b44757c43df173e8d21903f24bf56ceeece7f8;hp=7719090dba06dc64408efab82f94586b9716fe9e;hb=5a6cba5fde2b2f538a7515f8293cc0a8d9589dfa;hpb=af9c86ffb0e28d35ad94d99c5f77e41578c972b4 diff --git a/source/comm/CompatCodec.cpp b/source/comm/CompatCodec.cpp index 7719090..39b4475 100644 --- a/source/comm/CompatCodec.cpp +++ b/source/comm/CompatCodec.cpp @@ -29,7 +29,7 @@ bool comm::CompatCodec::st_initScramble(false); // static template comm::Variable* insert(const char* name, const short int id, M& theVector, T& value) -throw(RuntimeException) { +noexcept(false) { comm::Variable* result = theVector.find(id); if(result != NULL) @@ -46,7 +46,7 @@ throw(RuntimeException) { // static template comm::Variable* insertRef(const char* name, const short int id, M& theVector, T& value) -throw(RuntimeException) { +noexcept(false) { comm::Variable* result = theVector.find(id); if(result != NULL) @@ -80,12 +80,12 @@ comm::CompatCodec::~CompatCodec() { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, std::string& value) -throw(RuntimeException) { +noexcept(false) { return insert(name, id, a_variables, value); } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, int& value) -throw(RuntimeException) { +noexcept(false) { const int backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -93,7 +93,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, S64& value) -throw(RuntimeException) { +noexcept(false) { const S64 backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -101,7 +101,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, bool& value) -throw(RuntimeException) { +noexcept(false) { const bool backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -109,12 +109,12 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, DataBlock& value) -throw(RuntimeException) { +noexcept(false) { return insert(name, id, a_variables, value); } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, float& value) -throw(RuntimeException) { +noexcept(false) { const float backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -122,7 +122,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, double& value) -throw(RuntimeException) { +noexcept(false) { const double backup(value); const Variable* result = insert(name, id, a_variables, value); value = backup; @@ -130,7 +130,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, Second& value) -throw(RuntimeException) { +noexcept(false) { const Second backup(value); const Variable* result = insertRef(name, id, a_variables, value); value = backup; @@ -138,7 +138,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, Millisecond& value) -throw(RuntimeException) { +noexcept(false) { const Millisecond backup(value); const Variable* result = insertRef(name, id, a_variables, value); value = backup; @@ -146,7 +146,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, Microsecond& value) -throw(RuntimeException) { +noexcept(false) { const Microsecond backup(value); const Variable* result = insertRef(name, id, a_variables, value); value = backup; @@ -154,7 +154,7 @@ throw(RuntimeException) { } const comm::Variable* comm::CompatCodec::attach(const char* name, const short int id, comm::CompatCodec& value) -throw(RuntimeException) { +noexcept(false) { if(&value == this) { String msg("comm::CompatCodec::attach | Variable: "); msg << name << " | Can not link with itself"; @@ -165,7 +165,7 @@ throw(RuntimeException) { } void comm::CompatCodec::setNull(const short int id, const bool isNull) -throw(RuntimeException) { +noexcept(false) { Variable* variable = a_variables.find(id); if(variable == NULL) @@ -182,7 +182,7 @@ throw(RuntimeException) { } void comm::CompatCodec::setNull(const comm::Variable* variable, const bool isNull) -throw() { +{ if(variable->isNull()) { if(isNull == false) a_nullCounter --; } @@ -194,7 +194,7 @@ throw() { } bool comm::CompatCodec::isNull(const short int id) const -throw(RuntimeException) { +noexcept(false) { const Variable* variable = a_variables.find(id); if(variable == NULL) @@ -204,7 +204,7 @@ throw(RuntimeException) { } const comm::Variable& comm::CompatCodec::find(const short int id) const -throw(RuntimeException) { +noexcept(false) { const Variable* variable = a_variables.find(id); if(variable == NULL) @@ -240,7 +240,7 @@ throw(RuntimeException) { // la recogida de datos. //----------------------------------------------------------------------- const DataBlock& comm::CompatCodec::code() -throw(RuntimeException) { +noexcept(false) { unsigned char c(0); iterator ii; iterator maxii(a_variables.end()); @@ -334,7 +334,7 @@ throw(RuntimeException) { //------------------------------------------------------------------------------------------- void comm::CompatCodec::decode(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const char* data = dataBlock.getData(); const int size = dataBlock.getSize(); @@ -364,7 +364,7 @@ throw(RuntimeException) { // Decodifica los buffers que pueden contener variables nulas. //------------------------------------------------------------------------------------------- void comm::CompatCodec::normalDecode(const char* data, const int size, const int maxdata) -throw(RuntimeException) { +noexcept(false) { // Mientras no se demuestre lo contrario todas las variables son nulas a_nullCounter = a_variables.size(); @@ -454,7 +454,7 @@ throw(RuntimeException) { // (1) El codigo de la variable //------------------------------------------------------------------------------------------- bool comm::CompatCodec::optimizedDecode(const char* data, const int size) -throw(RuntimeException) { +noexcept(false) { int nbytes; Variable* variable; const char* top = data + size; @@ -510,7 +510,7 @@ throw(RuntimeException) { } comm::CompatCodec::Type comm::CompatCodec::getType(const DataBlock& dataBlock) -throw(RuntimeException) { +noexcept(false) { const int size(dataBlock.getSize()); if(size <= 1) @@ -531,7 +531,7 @@ comm::CompatCodec::VariableContainer::VariableContainer() { } void comm::CompatCodec::VariableContainer::add(comm::Variable* variable) -throw() { +{ if(a_size == a_maxSize) { int maxSize = (a_maxSize << 1) - (a_maxSize >> 1); Variable** variables = new Variable* [maxSize]; @@ -546,7 +546,7 @@ throw() { } comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) -throw() { +{ for(int ii = 0; ii < a_size; ii ++) { if(a_variables [ii]->getId() == id) return a_variables [ii]; @@ -556,7 +556,7 @@ throw() { } const comm::Variable* comm::CompatCodec::VariableContainer::find(const int id) const -throw() { +{ for(int ii = 0; ii < a_size; ii ++) { if(a_variables [ii]->getId() == id) return a_variables [ii]; @@ -566,7 +566,7 @@ throw() { } void comm::CompatCodec::VariableContainer::clear() -throw() { +{ delete [] a_variables; a_maxSize = a_size = 0; }