artdaq_mfextensions  v1_05_00
EHReplier.cc
1 #include <time.h>
2 #include <string>
3 #include <sstream>
4 
5 #include <rms/provider/DDSConnection.h>
6 #include <rms/base/RmsDestination.h>
7 #include <rms/RmsReceiver.h>
8 #include <rms/RmsSender.h>
9 
10 
11 #include <NovaTimingUtilities/TimingUtilities.h>
12 
13 #include <DAQMessages/ccpp_ErrorHandlerMessages.h>
14 
15 #include <boost/shared_ptr.hpp>
16 
17 using namespace gov::fnal::cd::rms;
18 using namespace novadaq::timeutils;
19 
20 
21 // just send a reply message
22 
23 
24 
25 int main() {
26 
27  // create the connection to RMS
28  boost::shared_ptr<provider::DDSConnection>
29  rmsConnection(new provider::DDSConnection("EHTestApplication",0));
30 
31 
32  // create the destination that represents where we will receive
33  // messages from
34  base::RmsDestination receiveDest("EHServerMailbox",
35  base::RmsDestination::EH_CHANNEL);
36 
37 
38 
39 
40  RmsSender<provider::DDSConnection,errorhandlermessages::ErrorHandlerReply>
41  requestSender(rmsConnection,receiveDest);
42 
43  errorhandlermessages::ErrorHandlerReply reply;
44  reply.action_complete = true;
45  requestSender.sendMessage(reply);
46  requestSender.close();
47 
48 
49 
50 
51  // cleanup and exit
52  rmsConnection->close();
53 
54  return 0;
55 }