ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
JiveXML
JiveXML
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
8
#include "
AthenaBaseComps/AthService.h
"
9
#include "
CxxUtils/checker_macros.h
"
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
16
namespace
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
94
int
m_portNumber
;
95
96
//A map of the streams and their current events
97
EventStreamMap
m_eventStreamMap
;
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
103
pthread_t
m_ServerThreadHandle
{};
104
105
//Once this flag is set to false, the thread will stop after handling its
106
//last request
107
bool
m_runServerThread
;
108
};
109
110
}
//namespace
111
112
#endif
113
AthService.h
EventStream.h
IServerSvc.h
IServer.h
checker_macros.h
Define macros for attributes used to control the static checker.
JiveXML::EventStreamID
For the client-server communication, each event is uniquely identified by the run number,...
Definition
EventStream.h:19
JiveXML::IServer
Pure abstract interface for all full server implementations.
Definition
IServer.h:22
JiveXML::ONCRPCServerSvc::GetState
virtual int GetState() const override
get the Status of the application
Definition
ONCRPCServerSvc.cxx:173
JiveXML::ONCRPCServerSvc::LogLevel
virtual MSG::Level LogLevel() const override
Get the logging level.
Definition
ONCRPCServerSvc.cxx:164
JiveXML::ONCRPCServerSvc::m_portNumber
int m_portNumber
Definition
ONCRPCServerSvc.h:94
JiveXML::ONCRPCServerSvc::GetEventStreamID
virtual const EventStreamID GetEventStreamID(const std::string &streamName) const override
get the current EventStreamID for a particular stream
Definition
ONCRPCServerSvc.cxx:221
JiveXML::ONCRPCServerSvc::GetRunServerFlag
virtual bool GetRunServerFlag() const override
The server thread will stop once this flag is set to false.
Definition
ONCRPCServerSvc.h:82
JiveXML::ONCRPCServerSvc::GetStreamNames
virtual std::vector< std::string > GetStreamNames() const override
get the names of all the streams
Definition
ONCRPCServerSvc.cxx:186
JiveXML::ONCRPCServerSvc::ONCRPCServerSvc
ONCRPCServerSvc(const std::string &name, ISvcLocator *sl)
Default constructor.
Definition
ONCRPCServerSvc.cxx:275
JiveXML::ONCRPCServerSvc::Message
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.
Definition
ONCRPCServerSvc.cxx:151
JiveXML::ONCRPCServerSvc::StopServer
StatusCode StopServer()
Stop the server thread.
Definition
ONCRPCServerSvc.cxx:68
JiveXML::ONCRPCServerSvc::m_eventStreamMap
EventStreamMap m_eventStreamMap
Definition
ONCRPCServerSvc.h:97
JiveXML::ONCRPCServerSvc::finalize
virtual StatusCode finalize() override
Finalize - called once at the end.
Definition
ONCRPCServerSvc.cxx:321
JiveXML::ONCRPCServerSvc::m_runServerThread
bool m_runServerThread
Definition
ONCRPCServerSvc.h:107
JiveXML::ONCRPCServerSvc::GetEvent
virtual const std::string GetEvent(const EventStreamID &evtStreamID) const override
get the current event for a particular stream
Definition
ONCRPCServerSvc.cxx:248
JiveXML::ONCRPCServerSvc::m_ServerThreadHandle
pthread_t m_ServerThreadHandle
Definition
ONCRPCServerSvc.h:103
JiveXML::ONCRPCServerSvc::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
ONCRPCServerSvc.cxx:333
JiveXML::ONCRPCServerSvc::~ONCRPCServerSvc
virtual ~ONCRPCServerSvc()
Destructor.
Definition
ONCRPCServerSvc.cxx:291
JiveXML::ONCRPCServerSvc::ServerThreadStopped
virtual void ServerThreadStopped() override
Callback when server thread terminates.
Definition
ONCRPCServerSvc.cxx:137
JiveXML::ONCRPCServerSvc::initialize
virtual StatusCode initialize() override
Gaudi default methods.
Definition
ONCRPCServerSvc.cxx:300
JiveXML::ONCRPCServerSvc::ATLAS_THREAD_SAFE
pthread_mutex_t m_accessLock ATLAS_THREAD_SAFE
Definition
ONCRPCServerSvc.h:100
JiveXML::ONCRPCServerSvc::StartServer
StatusCode StartServer()
Start the server thread.
Definition
ONCRPCServerSvc.cxx:33
JiveXML::ThreadCollection
This class handles a collection of threads.
Definition
ONCRPCThreadCollection.h:18
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition
BadLArRetriever.cxx:22
JiveXML::EventStreamMap
std::map< const EventStreamID, const std::string > EventStreamMap
Definition
EventStream.h:87
Generated on
for ATLAS Offline Software by
1.17.0