NdbEventOperation.cpp
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:3k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. /* Copyright (C) 2003 MySQL AB
  2.    This program is free software; you can redistribute it and/or modify
  3.    it under the terms of the GNU General Public License as published by
  4.    the Free Software Foundation; either version 2 of the License, or
  5.    (at your option) any later version.
  6.    This program is distributed in the hope that it will be useful,
  7.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  8.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9.    GNU General Public License for more details.
  10.    You should have received a copy of the GNU General Public License
  11.    along with this program; if not, write to the Free Software
  12.    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
  13. /*****************************************************************************
  14.  * Name:          NdbEventOperation.cpp
  15.  * Include:
  16.  * Link:
  17.  * Author:        Tomas Ulin MySQL AB
  18.  * Date:          2003-11-21
  19.  * Version:       0.1
  20.  * Description:   Event support
  21.  * Documentation:
  22.  * Adjust:  2003-11-21  Tomas Ulin   First version.
  23.  ****************************************************************************/
  24. #include <Ndb.hpp>
  25. #include <signaldata/SumaImpl.hpp>
  26. #include <portlib/NdbMem.h>
  27. #include <transporter/TransporterDefinitions.hpp>
  28. #include <NdbEventOperation.hpp>
  29. #include "NdbEventOperationImpl.hpp"
  30. #include "NdbDictionaryImpl.hpp"
  31. NdbEventOperation::NdbEventOperation(Ndb *theNdb, 
  32.      const char* eventName, 
  33.      int bufferLength) 
  34.   : m_impl(* new NdbEventOperationImpl(*this,theNdb, 
  35.        eventName, 
  36.        bufferLength))
  37. {
  38. }
  39. NdbEventOperation::~NdbEventOperation()
  40. {
  41.   NdbEventOperationImpl * tmp = &m_impl;
  42.   if (this != tmp)
  43.     delete tmp;
  44. }
  45. NdbEventOperation::State NdbEventOperation::getState()
  46. {
  47.   return m_impl.getState();
  48. }
  49. NdbRecAttr *
  50. NdbEventOperation::getValue(const char *colName, char *aValue)
  51. {
  52.   return m_impl.getValue(colName, aValue, 0);
  53. }
  54. NdbRecAttr *
  55. NdbEventOperation::getPreValue(const char *colName, char *aValue)
  56. {
  57.   return m_impl.getValue(colName, aValue, 1);
  58. }
  59. int
  60. NdbEventOperation::execute()
  61. {
  62.   return m_impl.execute();
  63. }
  64. int
  65. NdbEventOperation::next(int *pOverrun)
  66. {
  67.   return m_impl.next(pOverrun);
  68. }
  69. bool
  70. NdbEventOperation::isConsistent()
  71. {
  72.   return m_impl.isConsistent();
  73. }
  74. Uint32
  75. NdbEventOperation::getGCI()
  76. {
  77.   return m_impl.getGCI();
  78. }
  79. Uint32
  80. NdbEventOperation::getLatestGCI()
  81. {
  82.   return m_impl.getLatestGCI();
  83. }
  84. NdbDictionary::Event::TableEvent
  85. NdbEventOperation::getEventType()
  86. {
  87.   return m_impl.getEventType();
  88. }
  89. void
  90. NdbEventOperation::print()
  91. {
  92.   m_impl.print();
  93. }
  94. /*
  95.  * Private members
  96.  */
  97. int
  98. NdbEventOperation::wait(void *p, int aMillisecondNumber)
  99. {
  100.   return NdbEventOperationImpl::wait(p, aMillisecondNumber);
  101. }
  102. NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl) 
  103.   : m_impl(impl) {}