#include <objlib.h>
Convert class contents to JSON object.
Returns a json11 JSON object of the class
- Returns
- A json11 JSON object containing every member variable within the class
68 {
"groups" , d_groups },
69 {
"vertex" ,
static_cast<double>(
vertex) }
std::map< std::string, Json > object
Definition: json11.hpp:88
size_t vertex
Definition: objlib.h:59
vector< size_t > groups
Definition: objlib.h:58
void Cosmos::wavefront::point::from_json |
( |
const string & |
s | ) |
|
|
inline |
Set class contents from JSON string.
Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()
- Parameters
-
s | JSON-formatted string to set class contents to |
- Returns
- n/a
83 for(
size_t i = 0;
i <
groups.size(); ++
i) {
84 if(!p[
"groups"][
i].is_null())
85 groups[
i] = static_cast<size_t>(p[
"groups"][
i].number_value());
87 if(!p[
"vertex"].is_null())
vertex = static_cast<size_t>(p[
"vertex"].number_value());
89 cerr<<
"ERROR: <"<<error<<
">"<<endl;
Definition: json11.hpp:79
int i
Definition: rw_test.cpp:37
size_t vertex
Definition: objlib.h:59
static double * p
Definition: gauss_jackson_test.cpp:42
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
vector< size_t > groups
Definition: objlib.h:58
vector<size_t> Cosmos::wavefront::point::groups |
size_t Cosmos::wavefront::point::vertex = 0 |
The documentation for this struct was generated from the following file: