diff options
author | unknown <tomas@poseidon.bredbandsbolaget.se> | 2004-06-04 08:24:42 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.bredbandsbolaget.se> | 2004-06-04 08:24:42 +0000 |
commit | 9be85440427ae21e628a00772763147f07e730ff (patch) | |
tree | 990f2a02e0293f490a69a9ddd4130d628fb478e5 /ndb/src/ndbapi/NdbEventOperationImpl.cpp | |
parent | 65ee1426f45bcd010a01cbc4e545562ffe13afc6 (diff) | |
download | mariadb-git-9be85440427ae21e628a00772763147f07e730ff.tar.gz |
added operator<< for NdbRecAttr and removed attrtype from Event impl
ndb/include/ndbapi/NdbRecAttr.hpp:
operator << for NdbRecAttr
ndb/src/ndbapi/NdbEventOperationImpl.cpp:
removed print methid for ndbRecAttr in Event Impl
ndb/src/ndbapi/NdbEventOperationImpl.hpp:
removed print methid for ndbRecAttr in Event Impl
ndb/src/ndbapi/NdbRecAttr.cpp:
added operator<<
Diffstat (limited to 'ndb/src/ndbapi/NdbEventOperationImpl.cpp')
-rw-r--r-- | ndb/src/ndbapi/NdbEventOperationImpl.cpp | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 7b4afc72ef7..b73a58d97c4 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -499,8 +499,7 @@ NdbEventOperationImpl::print() NdbRecAttr *p = theFirstRecAttrs[i]; ndbout << " %u " << i; while (p) { - ndbout << " : " << p->attrId() << " = "; - printRecAttr(p); + ndbout << " : " << p->attrId() << " = " << *p; p = p->next(); } ndbout << "\n"; @@ -1248,60 +1247,3 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h, n += hasData(h->m_bufferIds[i]); return n; } - -/** - * TODO Change this function to use the real datatypes - * from NdbDictionary alternatively make a - * "printer" in NdbRecAttr that can be used from all programs - */ - -// and remove this include -#include "NdbSchemaOp.hpp" -void -NdbEventOperationImpl::printRecAttr(NdbRecAttr *p) -{ - int size = p->attrSize(); - int aSize = p->arraySize(); - - - switch(convertColumnTypeToAttrType(p->getType())){ - case UnSigned: - switch(size) { - case 8: ndbout << p->u_64_value(); break; - case 4: ndbout << p->u_32_value(); break; - case 2: ndbout << p->u_short_value(); break; - case 1: ndbout << (unsigned) p->u_char_value(); break; - default: ndbout << "Unknown size" << endl; - } - break; - - case Signed: - switch(size) { - case 8: ndbout << p->int64_value(); break; - case 4: ndbout << p->int32_value(); break; - case 2: ndbout << p->short_value(); break; - case 1: ndbout << (int) p->char_value(); break; - default: ndbout << "Unknown size" << endl; - } - break; - - case String: - { - char* buf = new char[aSize+1]; - memcpy(buf, p->aRef(), aSize); - buf[aSize] = 0; - ndbout << buf; - delete [] buf; - } - break; - - case Float: - ndbout << p->float_value(); - break; - - default: - ndbout << "Unknown"; - break; - } - -} |