25 int main(
int argc,
const char *argv[])
38 JParser<> zap(
"Auxiliary program to receive messages from ControlHost server.");
40 zap[
'H'] =
make_field(hostname,
"host name of message srver") =
"localhost";
43 zap[
'D'] =
make_field(date,
"print date and time of message receipt");
48 catch(
const exception &error) {
49 FATAL(error.what() << endl);
53 if (tagList.empty() && TagList.empty()) {
54 FATAL(
"No tags specified.");
58 JControlHost::Throw(
true);
62 JControlHost
in(hostname);
65 JSubscriptionList buffer;
68 buffer.add(JSubscriptionAny(*i));
72 buffer.add(JSubscriptionAll(*i));
75 in.MyId(
"JGetMessage");
84 for (
const string stop(
"stop"); buffer.size() !=
stop.size() ||
string(buffer.data(),
stop.size()) !=
stop; ) {
88 buffer.resize(prefix.getSize());
90 in.GetFullData(buffer.data(), buffer.size());
96 cout << left << setw(8) << prefix.getTag() <<
' ' << right << setw(8) << prefix.getSize();
98 if (TagList.find(prefix) != TagList.end()) {
99 cout <<
' ' <<
string(buffer.data(), buffer.size());
105 catch(
const JControlHostException& error) {
106 FATAL(error << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
then usage $script[port]< option > nPossible stop
static JDateAndTime getDateAndTime
Function object to get current date and time.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Utility class to parse command line options.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in