enginecontext.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 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. #ifndef ENGINECONTEXT_HPP
  14. #define ENGINECONTEXT_HPP
  15. #include "jsocket.hpp"
  16. #include "dacoven.hpp"
  17. typedef void (* QueryTermCallback)(const char *queryId);
  18. class TerminationCallbackInfo : public CInterface
  19. {
  20. public:
  21. TerminationCallbackInfo(QueryTermCallback _callback, const char *_id) : callback(_callback), id(_id) {}
  22. ~TerminationCallbackInfo()
  23. {
  24. callback(id);
  25. }
  26. protected:
  27. QueryTermCallback callback;
  28. StringAttr id;
  29. };
  30. interface IEngineContext
  31. {
  32. virtual DALI_UID getGlobalUniqueIds(unsigned num, SocketEndpoint *_foreignNode) = 0;
  33. virtual bool allowDaliAccess() const = 0;
  34. virtual StringBuffer &getQueryId(StringBuffer &result, bool isShared) const = 0;
  35. virtual void onTermination(QueryTermCallback callback, const char *key, bool isShared) const = 0;
  36. };
  37. #endif // ENGINECONTEXT_HPP