//////////////////////////////////////////////////////////////////// // // Output a DS::Entry and DS::Run packages over a socket. // The socket is specified on the command line. // // Author: Stan Seibert // P G Jones - contact person // // REVISION HISTORY: // 2014-04-26 : P Jones - refactor, add doxygen. // //////////////////////////////////////////////////////////////////// #ifndef __RAT_OutNetProc__ #define __RAT_OutNetProc__ #include #include #include #include #include namespace RAT { class OutNetProc : public Processor { public: // Construct the processor OutNetProc(); // Close the sockets ~OutNetProc(); // Begin of run, load from the database // // run: Data structure for the run void BeginOfRun( DS::Run& run ); // New event, write it out // // run: Data structure for the run // ds: Data structure for the event Processor::Result DSEvent( DS::Run& run, DS::Entry& ds ); // End of run, write out the run // // run: Data structure for the run void EndOfRun( DS::Run& run ); // Set a string parameter // // host - string, hostname and port in the form "hostname:port" // // param: parameter to set // value: value to set // Throws ParamInvalid if a mistake exists in the command // Throws ParamUnknown if a mistake exists in the command void SetS( const std::string& param, const std::string& value ); private: // Connect to the host:port // // host: host to connect to // port: port to connect to // Returns true if the connection succeeds bool Connect( const std::string& host, const int port ); TMonitor fMonitor; // Monitors the sockets std::vector fSockets; // Sockets to send from }; } // namespace RAT #endif