1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #include <anna/core/functions.hpp>
11 #include <anna/dbms/ShortBlock.hpp>
15 dbms::ShortBlock& dbms::ShortBlock::operator = (const dbms::ShortBlock & other)
16 throw(RuntimeException) {
20 if(other.isNull() == true) {
25 return operator= (other.a_value);
28 dbms::ShortBlock& dbms::ShortBlock::operator = (const anna::DataBlock & value)
29 throw(RuntimeException) {
30 if(value.getSize() > Data::getMaxSize()) {
31 throw RuntimeException(
33 "Block out of range | Max: %d | Current: %d ", Data::getMaxSize(), value.getSize()
40 setNull(a_value.isEmpty());
44 std::string dbms::ShortBlock::asString() const
46 std::string result("dbms::ShortBlock { ");
47 result += dbms::Data::asString();
48 result += " | Value: ";
49 result += isNull() ? "(null)" : functions::asString(a_value).c_str();
50 return result += " }";