Skip to content

Commit

Permalink
Merge pull request #359 from holmes1412/master
Browse files Browse the repository at this point in the history
Update RPCModule for concurrency issues.
  • Loading branch information
Barenboim authored Jan 30, 2024
2 parents 1add506 + 8e38763 commit cce3754
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 91 deletions.
21 changes: 21 additions & 0 deletions src/module/rpc_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,20 @@ class RPCFilter
this->module_type = module_type;
}

RPCFilter(const std::string name, enum RPCModuleType module_type)
{
size_t pos = name.find("::");
if (pos != std::string::npos)
this->filter_name = name.substr(0, pos) + "::";
else
this->filter_name = name + "::";
this->module_type = module_type;
}

virtual ~RPCFilter() { }

enum RPCModuleType get_module_type() const { return this->module_type; }
const std::string& get_name() const { return this->filter_name; }

virtual bool client_begin(SubTask *task, RPCModuleData& data)
{
Expand All @@ -91,8 +102,18 @@ class RPCFilter
return true;
}

const std::string raw_var_name(const std::string& name) const
{
size_t pos = name.find("::");
if (pos != std::string::npos)
return name.substr(pos + 2);
else
return name;
}

private:
enum RPCModuleType module_type;
std::string filter_name;
};

} // end namespace srpc
Expand Down
Loading

0 comments on commit cce3754

Please sign in to comment.