--- /dev/null
+// 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 <anna/core/functions.hpp>
+
+#include <anna/dbms/ShortBlock.hpp>
+
+using namespace anna;
+
+dbms::ShortBlock& dbms::ShortBlock::operator = (const dbms::ShortBlock & other)
+throw(RuntimeException) {
+ if(this == &other)
+ return *this;
+
+ if(other.isNull() == true) {
+ setNull(true);
+ return *this;
+ }
+
+ return operator= (other.a_value);
+}
+
+dbms::ShortBlock& dbms::ShortBlock::operator = (const anna::DataBlock & value)
+throw(RuntimeException) {
+ if(value.getSize() > Data::getMaxSize()) {
+ throw RuntimeException(
+ functions::asString(
+ "Block out of range | Max: %d | Current: %d ", Data::getMaxSize(), value.getSize()
+ ),
+ ANNA_FILE_LOCATION
+ );
+ }
+
+ a_value = value;
+ setNull(a_value.isEmpty());
+ return *this;
+}
+
+std::string dbms::ShortBlock::asString() const
+throw() {
+ std::string result("dbms::ShortBlock { ");
+ result += dbms::Data::asString();
+ result += " | Value: ";
+ result += isNull() ? "(null)" : functions::asString(a_value).c_str();
+ return result += " }";
+}
+