search_context.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Tencent is pleased to support the open source community by making wwsearch
  3. * available.
  4. *
  5. * Copyright (C) 2018-present Tencent. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  8. * use this file except in compliance with the License. You may obtain a copy of
  9. * the License at
  10. *
  11. * https://opensource.org/licenses/Apache-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OF ANY KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations under the License.
  17. */
  18. #pragma once
  19. #include "index_config.h"
  20. #include "search_status.h"
  21. #include "virtual_db.h"
  22. namespace wwsearch {
  23. class SearchContext {
  24. private:
  25. TableID table_;
  26. VirtualDB *vdb_;
  27. VirtualDBSnapshot *snapshot_;
  28. IndexConfig *config_;
  29. SearchStatus status_;
  30. public:
  31. SearchContext(TableID table, VirtualDB *vdb, VirtualDBSnapshot *snapshot,
  32. IndexConfig *config)
  33. : table_(table), vdb_(vdb), snapshot_(snapshot), config_(config) {}
  34. virtual ~SearchContext() {}
  35. inline VirtualDB *VDB() { return this->vdb_; }
  36. inline VirtualDBSnapshot *GetSnapshot() { return this->snapshot_; }
  37. inline IndexConfig *GetConfig() { return this->config_; }
  38. inline TableID Table() { return this->table_; }
  39. inline SearchStatus &Status() { return this->status_; }
  40. private:
  41. };
  42. } // namespace wwsearch