ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
JiveXML
src
StreamToServerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <
JiveXML/StreamToServerTool.h
>
6
7
namespace
JiveXML
{
8
14
StreamToServerTool::StreamToServerTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* p):
15
AthAlgTool
(
type
,name,p),
16
m_ServerSvc
(
"JiveXML::ONCRPCServerSvc"
,name){
17
18
//Provide interface
19
declareInterface<IStreamTool>(
this
);
20
22
declareProperty
(
"StreamName"
,
m_StreamName
=
"default"
);
24
declareProperty
(
"ServerService"
,
m_ServerSvc
);
25
}
26
30
StatusCode
StreamToServerTool::initialize
(){
31
32
//Make sure we can get hold of the server and the online event displays service
33
if
(
m_ServerSvc
.retrieve().isFailure()){
34
ATH_MSG_ERROR
(
"Unable to initialize server service with name "
<<
m_ServerSvc
.name());
35
return
StatusCode::FAILURE;
36
}
37
38
if
(
m_onlineEDsvc
.retrieve().isFailure()){
39
ATH_MSG_ERROR
(
"Could not locate the online event displays service"
);
40
return
StatusCode::FAILURE;
41
}
42
43
return
StatusCode::SUCCESS;
44
}
45
49
StatusCode
StreamToServerTool::finalize
(){
50
return
StatusCode::SUCCESS;
51
}
52
59
StatusCode
StreamToServerTool::StreamEvent
(
const
unsigned
long
EventNumber,
60
const
unsigned
int
RunNumber,
61
const
std::ostringstream*
const
EventBuffer ) {
62
m_StreamName
=
m_onlineEDsvc
->getStreamName();
63
ATH_MSG_VERBOSE
(
"Streaming event Number "
<< EventNumber
64
<<
" from run Number "
<< RunNumber
65
<<
" to stream "
<<
m_StreamName
66
<<
" on "
<<
m_ServerSvc
.name() <<
" service"
);
67
69
EventStreamID
evtStreamID(EventNumber,RunNumber,
m_StreamName
);
70
72
return
m_ServerSvc
->UpdateEventForStream(evtStreamID,EventBuffer->str());
73
}
74
75
}
//namespace
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
StreamToServerTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
JiveXML::EventStreamID
For the client-server communication, each event is uniquely identified by the run number,...
Definition
EventStream.h:19
JiveXML::StreamToServerTool::initialize
virtual StatusCode initialize()
Initialize.
Definition
StreamToServerTool.cxx:30
JiveXML::StreamToServerTool::m_onlineEDsvc
ServiceHandle< IOnlineEventDisplaysSvc > m_onlineEDsvc
Definition
StreamToServerTool.h:45
JiveXML::StreamToServerTool::StreamToServerTool
StreamToServerTool(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition
StreamToServerTool.cxx:14
JiveXML::StreamToServerTool::m_StreamName
std::string m_StreamName
Stream name under which these events shall appear.
Definition
StreamToServerTool.h:49
JiveXML::StreamToServerTool::StreamEvent
virtual StatusCode StreamEvent(const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream *const EventBuffer)
Stream one event.
Definition
StreamToServerTool.cxx:59
JiveXML::StreamToServerTool::m_ServerSvc
ServiceHandle< IServerSvc > m_ServerSvc
Handle to the server that this tools shall stream events to.
Definition
StreamToServerTool.h:44
JiveXML::StreamToServerTool::finalize
virtual StatusCode finalize()
Finalize.
Definition
StreamToServerTool.cxx:49
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition
BadLArRetriever.cxx:22
type
Generated on
for ATLAS Offline Software by
1.17.0