ATLAS Offline Software
Loading...
Searching...
No Matches
ONCRPCServerSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef JIVEXML_ONCRPCSERVERSVC_H
6#define JIVEXML_ONCRPCSERVERSVC_H
7
10#include "GaudiKernel/ServiceHandle.h"
11#include "GaudiKernel/MsgStream.h"
12#include "JiveXML/EventStream.h"
13#include "JiveXML/IServerSvc.h"
14#include "JiveXML/IServer.h"
15
16namespace JiveXML {
17
18 //forward declarations
19 class ThreadCollection;
20
41
42 class ONCRPCServerSvc : public extends<AthService, IServerSvc>,
43 virtual public IServer {
44 public:
45
47 ONCRPCServerSvc(const std::string& name, ISvcLocator* sl);
49 virtual ~ONCRPCServerSvc();
50
52 virtual StatusCode initialize() override;
53 virtual StatusCode finalize() override;
54
55
58
59 virtual int GetState() const override;
61 virtual std::vector<std::string> GetStreamNames() const override;
63 virtual const EventStreamID GetEventStreamID(const std::string& streamName) const override;
65 virtual
66 const std::string GetEvent( const EventStreamID& evtStreamID ) const override;
68 virtual StatusCode UpdateEventForStream( const EventStreamID& evtStreamID, const std::string & event) override;
70
75 virtual
76 void Message( const MSG::Level level, const std::string& mesg ) const override;
78 virtual MSG::Level LogLevel() const override;
79
80
82 virtual bool GetRunServerFlag () const override { return m_runServerThread; };
84 StatusCode StartServer();
86 StatusCode StopServer();
88 virtual void ServerThreadStopped() override;
89
90 private:
91
92 //Port number property - defaults to zero in which case
93 //it is dynamically assigned
95
96 //A map of the streams and their current events
98
99 //A mutex (mutual exclusive) lock for the data map
100 mutable pthread_mutex_t m_accessLock ATLAS_THREAD_SAFE{};
101
102 //A handle to the server thread
104
105 //Once this flag is set to false, the thread will stop after handling its
106 //last request
108 };
109
110} //namespace
111
112#endif
113
Define macros for attributes used to control the static checker.
For the client-server communication, each event is uniquely identified by the run number,...
Definition EventStream.h:19
Pure abstract interface for all full server implementations.
Definition IServer.h:22
virtual int GetState() const override
get the Status of the application
virtual MSG::Level LogLevel() const override
Get the logging level.
virtual const EventStreamID GetEventStreamID(const std::string &streamName) const override
get the current EventStreamID for a particular stream
virtual bool GetRunServerFlag() const override
The server thread will stop once this flag is set to false.
virtual std::vector< std::string > GetStreamNames() const override
get the names of all the streams
ONCRPCServerSvc(const std::string &name, ISvcLocator *sl)
Default constructor.
virtual void Message(const MSG::Level level, const std::string &mesg) const override
This function is exposed to allow using athena messaging service from other threads.
StatusCode StopServer()
Stop the server thread.
EventStreamMap m_eventStreamMap
virtual StatusCode finalize() override
Finalize - called once at the end.
virtual const std::string GetEvent(const EventStreamID &evtStreamID) const override
get the current event for a particular stream
virtual StatusCode UpdateEventForStream(const EventStreamID &evtStreamID, const std::string &event) override
Put this event as new current event for stream given by name.
virtual ~ONCRPCServerSvc()
Destructor.
virtual void ServerThreadStopped() override
Callback when server thread terminates.
virtual StatusCode initialize() override
Gaudi default methods.
pthread_mutex_t m_accessLock ATLAS_THREAD_SAFE
StatusCode StartServer()
Start the server thread.
This class handles a collection of threads.
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::map< const EventStreamID, const std::string > EventStreamMap
Definition EventStream.h:87