diff options
Diffstat (limited to 'ndb/include/ndbapi/NdbReceiver.hpp')
-rw-r--r-- | ndb/include/ndbapi/NdbReceiver.hpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index a1a08a9735a..13898fc8e5f 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -23,6 +23,12 @@ class Ndb; class NdbReceiver { + friend class Ndb; + friend class NdbOperation; + friend class NdbScanOperation; + friend class NdbIndexOperation; + friend class NdbIndexScanOperation; + friend class NdbConnection; public: enum ReceiverType { NDB_UNINITIALIZED, NDB_OPERATION = 1, @@ -32,6 +38,7 @@ public: NdbReceiver(Ndb *aNdb); void init(ReceiverType type, void* owner); + void release(); ~NdbReceiver(); Uint32 getId(){ @@ -42,18 +49,51 @@ public: return m_type; } + inline NdbConnection * getTransaction(); void* getOwner(){ return m_owner; } bool checkMagicNumber() const; + inline void next(NdbReceiver* next) { m_next = next;} + inline NdbReceiver* next() { return m_next; } + private: Uint32 theMagicNumber; Ndb* m_ndb; Uint32 m_id; + Uint32 m_tcPtrI; + Uint32 m_key_info; ReceiverType m_type; void* m_owner; + NdbReceiver* m_next; + + /** + * At setup + */ + class NdbRecAttr * getValue(const class NdbColumnImpl*, char * user_dst_ptr); + void do_get_value(NdbReceiver*, Uint32 rows, Uint32 key_size); + void prepareSend(); + + int execKEYINFO20(Uint32 info, const Uint32* ptr, Uint32 len); + int execTRANSID_AI(const Uint32* ptr, Uint32 len); + int execTCOPCONF(Uint32 len); + int execSCANOPCONF(Uint32 tcPtrI, Uint32 len, Uint32 rows); + class NdbRecAttr* theFirstRecAttr; + class NdbRecAttr* theCurrentRecAttr; + class NdbRecAttr** m_rows; + + Uint32 m_list_index; // When using multiple + Uint32 m_current_row; + Uint32 m_result_rows; + Uint32 m_defined_rows; + + Uint32 m_expected_result_length; + Uint32 m_received_result_length; + + bool nextResult() const { return m_current_row < m_result_rows; } + void copyout(NdbReceiver&); }; #ifdef NDB_NO_DROPPED_SIGNAL @@ -72,5 +112,32 @@ NdbReceiver::checkMagicNumber() const { return retVal; } +inline +void +NdbReceiver::prepareSend(){ + m_current_row = 0; + m_received_result_length = 0; + m_expected_result_length = 0; + theCurrentRecAttr = theFirstRecAttr; +} + +inline +int +NdbReceiver::execTCOPCONF(Uint32 len){ + Uint32 tmp = m_received_result_length; + m_expected_result_length = len; + return (tmp == len ? 1 : 0); +} + +inline +int +NdbReceiver::execSCANOPCONF(Uint32 tcPtrI, Uint32 len, Uint32 rows){ + m_tcPtrI = tcPtrI; + m_result_rows = rows; + Uint32 tmp = m_received_result_length; + m_expected_result_length = len; + return (tmp == len ? 1 : 0); +} + #endif #endif |