COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
busstruc Struct Reference

#include <jsondef.h>

Collaboration diagram for busstruc:

Public Member Functions

json11::Json to_json () const
 Convert class contents to JSON object. More...
 
void from_json (const string &s)
 Set class contents from JSON string. More...
 

Public Attributes

float wdt = 0.f
 Watch Dog Timer (MJD) More...
 

Member Function Documentation

json11::Json busstruc::to_json ( ) const
inline

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
3081  {
3082  return json11::Json::object {
3083  { "wdt" , wdt }
3084  };
3085  }
std::map< std::string, Json > object
Definition: json11.hpp:88
float wdt
Watch Dog Timer (MJD)
Definition: jsondef.h:3075
void busstruc::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
sJSON-formatted string to set class contents to
Returns
n/a
3093  {
3094  string error;
3095  json11::Json parsed = json11::Json::parse(s,error);
3096  if(error.empty()) {
3097  if(!parsed["wdt"].is_null()) { wdt = parsed["wdt"].number_value();}
3098  } else {
3099  cerr<<"ERROR: <"<<error<<">"<<endl;
3100  }
3101  return;
3102  }
Definition: json11.hpp:79
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
float wdt
Watch Dog Timer (MJD)
Definition: jsondef.h:3075
double number_value() const
Definition: json11.cpp:280

Member Data Documentation

float busstruc::wdt = 0.f

Watch Dog Timer (MJD)


The documentation for this struct was generated from the following file: