Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The methods for converting JSON to datapoint are modified in "static". #1129

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions C/common/datapoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ std::vector<Datapoint*> *Datapoint::parseJson(const std::string& json) {
if (!document.IsObject()) {
return nullptr;
}
return recursiveJson(document);
return Datapoint::recursiveJson(document);
}

/**
Expand All @@ -384,7 +384,7 @@ std::vector<Datapoint*> *Datapoint::recursiveJson(const rapidjson::Value& docume
for (rapidjson::Value::ConstMemberIterator itr = document.MemberBegin(); itr != document.MemberEnd(); ++itr)
{
if (itr->value.IsObject()) {
std::vector<Datapoint*> * vec = recursiveJson(itr->value);
std::vector<Datapoint*> * vec = Datapoint::recursiveJson(itr->value);
DatapointValue d(vec, true);
p->push_back(new Datapoint(itr->name.GetString(), d));
}
Expand Down
4 changes: 2 additions & 2 deletions C/common/include/datapoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ class Datapoint {
* Parse a json string and generates
* a corresponding datapoint vector
*/
std::vector<Datapoint*>* parseJson(const std::string& json);
std::vector<Datapoint*>* recursiveJson(const rapidjson::Value& document);
static std::vector<Datapoint*>* parseJson(const std::string& json);
static std::vector<Datapoint*>* recursiveJson(const rapidjson::Value& document);

private:
std::string m_name;
Expand Down