Skip to content

Commit

Permalink
relocating cache map to subclass for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ifadams committed Jul 29, 2024
1 parent e502e34 commit 643831c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/DescriptorsCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class DescriptorsCommand : public RSCommand {
// for this data structure in tbb
tbb::concurrent_unordered_map<long, IDDistancePair *> _cache_map;

static tbb::concurrent_unordered_map<std::string, std::string>
_desc_set_locator;
static tbb::concurrent_unordered_map<std::string, int> _desc_set_dims;

// Will return the path to the set and the dimensions
std::string get_set_path(PMGDQuery &query_tx, const std::string &set,
int &dim);
Expand Down
6 changes: 3 additions & 3 deletions src/QueryHandlerPMGD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ using namespace VDMS;
std::unordered_map<std::string, RSCommand *> QueryHandlerPMGD::_rs_cmds;

// Static globals for use in looking up descriptor set locations, defined in
// RSCommand.h
// DescriptorCommand.h
tbb::concurrent_unordered_map<std::string, std::string>
RSCommand::_desc_set_locator;
tbb::concurrent_unordered_map<std::string, int> RSCommand::_desc_set_dims;
DescriptorsCommand::_desc_set_locator;
tbb::concurrent_unordered_map<std::string, int> DescriptorsCommand::_desc_set_dims;

void QueryHandlerPMGD::init() {
DescriptorsManager::init();
Expand Down
4 changes: 0 additions & 4 deletions src/RSCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ class RSCommand {
const std::string _cmd_name;
std::map<std::string, int> _valid_params_map;

static tbb::concurrent_unordered_map<std::string, std::string>
_desc_set_locator;
static tbb::concurrent_unordered_map<std::string, int> _desc_set_dims;

template <typename T>
T get_value(const Json::Value &json, const std::string &key, T def = T());

Expand Down

0 comments on commit 643831c

Please sign in to comment.