Agent control structure.
More...
#include <jsondef.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
1041 {
"ifcnt" ,
static_cast<int>(
ifcnt) },
std::map< std::string, Json > object
Definition: json11.hpp:88
uint16_t stateflag
Agent Running State Flag.
Definition: jsondef.h:1025
bool client
Client initialized?
Definition: jsondef.h:1009
double aprd
Activity period in seconds.
Definition: jsondef.h:1023
int32_t pid
Agent process ID.
Definition: jsondef.h:1021
beatstruc beat
Heartbeat.
Definition: jsondef.h:1029
size_t ifcnt
Number of network interfaces.
Definition: jsondef.h:1015
bool server
Server initialized?
Definition: jsondef.h:1013
void agentstruc::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
1065 if(!p[
"ifcnt"].is_null()) {
ifcnt =
static_cast<size_t>(p[
"ifcnt"].
number_value()); }
1073 if(!p[
"pid"].is_null()) {
pid = p[
"pid"].
int_value(); }
1083 cerr<<
"ERROR: <"<<error<<
">"<<endl;
Definition: json11.hpp:79
uint16_t stateflag
Agent Running State Flag.
Definition: jsondef.h:1025
void from_json(const string &s)
Set class contents from JSON string.
Definition: jsondef.h:980
bool client
Client initialized?
Definition: jsondef.h:1009
double aprd
Activity period in seconds.
Definition: jsondef.h:1023
static double * p
Definition: gauss_jackson_test.cpp:42
int32_t pid
Agent process ID.
Definition: jsondef.h:1021
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
beatstruc beat
Heartbeat.
Definition: jsondef.h:1029
bool bool_value() const
Definition: json11.cpp:282
const array & array_items() const
Definition: json11.cpp:284
size_t ifcnt
Number of network interfaces.
Definition: jsondef.h:1015
int int_value() const
Definition: json11.cpp:281
double number_value() const
Definition: json11.cpp:280
bool server
Server initialized?
Definition: jsondef.h:1013
bool agentstruc::client = true |
Subscription channel (for Client)
bool agentstruc::server = true |
size_t agentstruc::ifcnt = 0 |
Number of network interfaces.
Publication channels for each interface (for Server)
Request channel (for Server)
int32_t agentstruc::pid = 0 |
double agentstruc::aprd = 0. |
Activity period in seconds.
uint16_t agentstruc::stateflag = 0 |
Agent Running State Flag.
The documentation for this struct was generated from the following file: