jrowstream.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #include "platform.h"
  14. #include "jrowstream.hpp"
  15. //---------------------------------------------------------------------------------------------------------------------
  16. class NullDiskRowStream : public CInterfaceOf<IDiskRowStream>
  17. {
  18. virtual bool getCursor(MemoryBuffer & cursor) override
  19. {
  20. return true;
  21. }
  22. virtual void setCursor(MemoryBuffer & cursor) override
  23. {
  24. }
  25. virtual void stop()
  26. {
  27. }
  28. virtual const void *nextRow(size32_t & size) override
  29. {
  30. size = 0;
  31. return eofRow;
  32. }
  33. virtual const void *nextRow() override
  34. {
  35. return eofRow;
  36. }
  37. virtual const void *nextRow(MemoryBufferBuilder & builder) override
  38. {
  39. return eofRow;
  40. }
  41. };
  42. static NullDiskRowStream nullDiskRowStream;
  43. IDiskRowStream * queryNullDiskRowStream()
  44. {
  45. return &nullDiskRowStream;
  46. }