ATLAS Offline Software
ONCRPCXDRProcs.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // lots of const violations in this C-code
9 
10 namespace JiveXML {
11 
12 
18  //De-/Encoding of Streams_t
19  bool_t xdr_streams( XDR* xdrsp, Streams* streams ){
20 
21  // As we do not know the string length, we use xdr_wrap_string
22  return (xdr_array( xdrsp, (caddr_t*)&streams->StreamNames, &streams->NStreams,
23  NSTREAMMAX, sizeof(char*), (xdrproc_t)xdr_wrapstring));
24  }
25 
31  //De-/Encoding of EventRequest_t
32  bool_t xdr_event_req( XDR* xdrsp, EventRequest* eventReq ){
33 
34  //de-/encode event number
35  if (! xdr_int64_t( xdrsp, &(eventReq->EventNumber)))
36  return false ;
37 
38  //de-/encode run number
39  if (! xdr_int64_t( xdrsp, &(eventReq->RunNumber)))
40  return false ;
41 
42  //de-/encode stream name
43  if (! xdr_wrapstring( xdrsp, (char**)&(eventReq->StreamName)))
44  return false ;
45 
46  // All done successfully
47  return true ;
48  }
49 
50  //De-/Encoding of Event_t
51  bool_t xdr_event( XDR* xdrsp, Event* event ){
52 
53  //de-/encode is-available bit
54  if (! xdr_bool( xdrsp, &(event->isAvailable)))
55  return false ;
56 
57  //de-/encode is-available bit
58  if (! xdr_bool( xdrsp, &(event->isIdentical)))
59  return false ;
60 
61  //de-/encode is-available bit
62  if (! xdr_bool( xdrsp, &(event->isCompressed)))
63  return false ;
64 
65  //de-/encode stream name
66  if (! xdr_wrapstring( xdrsp, (char**)&(event->StreamName)))
67  return false ;
68 
69  //de-/encode event number
70  if (! xdr_int64_t( xdrsp, &(event->EventNumber)))
71  return false ;
72 
73  //de-/encode run number
74  if (! xdr_int64_t( xdrsp, &(event->RunNumber)))
75  return false ;
76 
77  // wrap data as an array of bytes with length NBytes - this allows non-null
78  // terminated byte arrays to be send. Also - in contrast to an array - no
79  // subroutine is called for each byte. Instead, the string is just padded
80  // with null-char to obtain a length divisible by four
81  return (xdr_bytes( xdrsp, (caddr_t*)&event->EventData, &event->NBytes, NBYTESMAX));
82  }
83 }
84 
85 
python.outputTest_v2.streams
streams
Definition: outputTest_v2.py:55
JiveXML::EventRequest_t::RunNumber
int64_t RunNumber
Definition: ONCRPCServer.h:60
JiveXML::EventRequest_t::EventNumber
int64_t EventNumber
Definition: ONCRPCServer.h:59
JiveXML::xdr_streams
bool_t xdr_streams(XDR *xdrsp, Streams *streams)
De- and Encoding of Streams_t.
Definition: ONCRPCXDRProcs.cxx:19
JiveXML::EventRequest_t
Definition: ONCRPCServer.h:58
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
JiveXML::xdr_event_req
bool_t xdr_event_req(XDR *xdrsp, EventRequest *eventReq)
De-/Encoding of EventRequest_t.
Definition: ONCRPCXDRProcs.cxx:32
JiveXML::xdr_event
bool_t xdr_event(XDR *xdrsp, Event *event)
De-/Encoding of Event_t.
Definition: ONCRPCXDRProcs.cxx:51
JiveXML::EventRequest_t::StreamName
const char * StreamName
Definition: ONCRPCServer.h:61
ONCRPCXDRProcs.h
JiveXML::NBYTESMAX
const unsigned int NBYTESMAX
Definition: ONCRPCServer.h:40
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:22
JiveXML::Streams_t
Definition: ONCRPCServer.h:46
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: ONCRPCXDRProcs.cxx:8
JiveXML::Event_t
Definition: ONCRPCServer.h:66
checker_macros.h
Define macros for attributes used to control the static checker.
JiveXML::NSTREAMMAX
const unsigned int NSTREAMMAX
Definition: ONCRPCServer.h:38