ATLAS Offline Software
ExternalONCRPCServerSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JIVEXML_ExternalONCRPCSERVERSVC_H
6 #define JIVEXML_ExternalONCRPCSERVERSVC_H
7 
9 #include "GaudiKernel/ServiceHandle.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "JiveXML/EventStream.h"
12 #include "JiveXML/IServerSvc.h"
13 
14 #include <rpc/clnt.h>
15 
16 namespace JiveXML {
17 
23  class ExternalONCRPCServerSvc : public extends1<AthService, IServerSvc> {
24 
25  public:
26 
28  ExternalONCRPCServerSvc(const std::string& name, ISvcLocator* sl);
30  virtual ~ExternalONCRPCServerSvc();
31 
33  virtual StatusCode initialize() override;
34  virtual StatusCode finalize() override;
35 
39  virtual StatusCode UpdateEventForStream( const EventStreamID& evtStreamID, const std::string & event) override;
41 
42  private:
43 
44  //Instantiate and release the client handle
47 
48  //Get a timeval struct from the timeout double
49  struct timeval GetTimeout();
50 
51  //The name of the machine the external server is running on
52  //defaults to "localhost"
53  std::string m_hostName;
54 
55  //The timeout when calling the server in seconds
56  double m_timeOut;
57 
58  //A client handle
59  CLIENT* m_client;
60  };
61 
62 } //namespace
63 
64 #endif
65 
JiveXML::ExternalONCRPCServerSvc::GetClient
StatusCode GetClient()
Obtain a client handle by.
Definition: ExternalONCRPCServerSvc.cxx:60
JiveXML::ExternalONCRPCServerSvc::ExternalONCRPCServerSvc
ExternalONCRPCServerSvc(const std::string &name, ISvcLocator *sl)
Default constructor.
Definition: ExternalONCRPCServerSvc.cxx:17
JiveXML::ExternalONCRPCServerSvc::initialize
virtual StatusCode initialize() override
Gaudi default methods.
Definition: ExternalONCRPCServerSvc.cxx:37
IServerSvc.h
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JiveXML::ExternalONCRPCServerSvc::m_client
CLIENT * m_client
Definition: ExternalONCRPCServerSvc.h:59
JiveXML::ExternalONCRPCServerSvc
This athena service will provide a link to an external ONCRPC server, e.g running as standalone appli...
Definition: ExternalONCRPCServerSvc.h:23
JiveXML::ExternalONCRPCServerSvc::GetTimeout
struct timeval GetTimeout()
Convert timeout double in seconds to struct timeval.
Definition: ExternalONCRPCServerSvc.cxx:108
JiveXML::EventStreamID
For the client-server communication, each event is uniquely identified by the run number,...
Definition: EventStream.h:19
JiveXML::ExternalONCRPCServerSvc::~ExternalONCRPCServerSvc
virtual ~ExternalONCRPCServerSvc()
Destructor.
Definition: ExternalONCRPCServerSvc.cxx:29
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:21
JiveXML::ExternalONCRPCServerSvc::m_timeOut
double m_timeOut
Definition: ExternalONCRPCServerSvc.h:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
JiveXML::ExternalONCRPCServerSvc::ReleaseClient
StatusCode ReleaseClient()
Destroy the private client handle.
Definition: ExternalONCRPCServerSvc.cxx:124
JiveXML::ExternalONCRPCServerSvc::UpdateEventForStream
virtual StatusCode UpdateEventForStream(const EventStreamID &evtStreamID, const std::string &event) override
Put this event as new current event for stream given by name.
Definition: ExternalONCRPCServerSvc.cxx:153
JiveXML::ExternalONCRPCServerSvc::finalize
virtual StatusCode finalize() override
Finalize - called once at the end.
Definition: ExternalONCRPCServerSvc.cxx:137
AthService.h
EventStream.h
JiveXML::ExternalONCRPCServerSvc::m_hostName
std::string m_hostName
Definition: ExternalONCRPCServerSvc.h:53