Program to demonstrate inter-communication between agents.
79 string agent_target =
"agent_001";
111 cout<<
"attempting 1.0 way of getting UTC value..."<<endl;
112 string request3 =
"getvalue {\"node_loc_utc\"}";
113 cout<<
" request = <"<<request3<<
">"<<endl;
115 cout<<
" response = <"<<response3<<
">"<<endl;
119 cout<<
"attempting 2.0 way of getting UTC value with short name..."<<endl;
120 string request4 =
"get_value \"Short UTC\"";
121 cout<<
" request = <"<<request4<<
">"<<endl;
123 cout<<
" response = <"<<response4<<
">"<<endl;
127 cout<<
"attempting 2.0 way of getting UTC value with long name..."<<endl;
128 string request7 =
"get_value \"Longest Ever UTC\"";
129 cout<<
" request = <"<<request7<<
">"<<endl;
131 cout<<
" response = <"<<response7<<
">"<<endl;
133 string req =
"get_value \"Longest Ever UTC\" \"Short UTC\"";
134 cout<<
" request = <"<<req<<
">"<<endl;
137 cout<<
" response = <"<<res<<
">"<<endl;
147 req =
"set_value {\"Longest Ever UTC\": 215},{\"user[0].tool\": \"Super Tool!\"}";
148 cout<<
" request = <"<<req<<
">"<<endl;
151 cout<<
" response = <"<<res<<
">"<<endl;
154 req =
"get_value \"user\"";
155 cout<<
" request = <"<<req<<
">"<<endl;
158 cout<<
" response = <"<<res<<
">"<<endl;
int32_t send_request(beatstruc cbeat, string request, string &output, float waitsec=5.)
Send a request over AGENT.
Definition: agentclass.cpp:424
int32_t hello_agent_002_request_function(string &request, string &response, Agent *cdata)
The function to handle agent_001's request.
Definition: agent_002.cpp:177
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
string node_agent_name
Definition: agent_002.cpp:49
string node_name
ensure only one agent class instance per process
Definition: agent_002.cpp:47
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
Definition: agentclass.h:139
static Agent * agent
Definition: agent_002.cpp:50
int32_t last_error()
Definition: agentclass.cpp:414
beatstruc find_agent(string node, string agent, double waitsec=0.)
Find agent.
Definition: agentclass.cpp:559
string agent_name
Definition: agent_002.cpp:48