ROOT
Version v6.32
master
v6.34
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
►
bindings
►
core
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
html
►
io
►
main
►
math
►
montecarlo
►
net
▼
proof
►
doc
►
proof
►
proofbench
►
proofd
►
proofplayer
►
proofx
▼
xrdinc
►
Xrd
▼
XrdClient
►
XrdClientConn.hh
►
XrdClientConnMgr.hh
►
XrdClientConst.hh
►
XrdClientEnv.hh
►
XrdClientInputBuffer.hh
►
XrdClientLogConnection.hh
►
XrdClientMessage.hh
►
XrdClientPhyConnection.hh
►
XrdClientReadCache.hh
►
XrdClientSock.hh
►
XrdClientUnsolMsg.hh
►
XrdClientUrlInfo.hh
►
XrdClientVector.hh
►
XrdSys
►
roofit
►
sql
►
tmva
►
tree
►
tutorials
►
v6-32-00-patches
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
XrdClientInputBuffer.hh
Go to the documentation of this file.
1
#ifndef XRC_INPUTBUFFER_H
2
#define XRC_INPUTBUFFER_H
3
/******************************************************************************/
4
/* */
5
/* X r d C l i e n t I n p u t B u f f e r . h h */
6
/* */
7
/* Author: Fabrizio Furano (INFN Padova, 2004) */
8
/* Adapted from TXNetFile (root.cern.ch) originally done by */
9
/* Alvise Dorigo, Fabrizio Furano */
10
/* INFN Padova, 2003 */
11
/* */
12
/* This file is part of the XRootD software suite. */
13
/* */
14
/* XRootD is free software: you can redistribute it and/or modify it under */
15
/* the terms of the GNU Lesser General Public License as published by the */
16
/* Free Software Foundation, either version 3 of the License, or (at your */
17
/* option) any later version. */
18
/* */
19
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22
/* License for more details. */
23
/* */
24
/* You should have received a copy of the GNU Lesser General Public License */
25
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27
/* */
28
/* The copyright holder's institutional names and contributor's names may not */
29
/* be used to endorse or promote products derived from this software without */
30
/* specific prior written permission of the institution or contributor. */
31
/******************************************************************************/
32
33
//////////////////////////////////////////////////////////////////////////
34
// //
35
// Buffer for incoming messages (responses) //
36
// Handles the waiting (with timeout) for a message to come //
37
// belonging to a logical streamid //
38
// Multithread friendly //
39
// //
40
//////////////////////////////////////////////////////////////////////////
41
42
#include "
XrdClient/XrdClientMessage.hh
"
43
#include "XrdSys/XrdSysPthread.hh"
44
#include "XrdSys/XrdSysSemWait.hh"
45
#include "XrdOuc/XrdOucHash.hh"
46
#include "
XrdClient/XrdClientVector.hh
"
47
48
class
XrdClientInputBuffer
{
49
50
private
:
51
52
XrdClientVector<XrdClientMessage*>
fMsgQue
;
// queue for incoming messages
53
int
fMsgIter
;
// an iterator on it
54
55
XrdSysRecMutex
fMutex
;
// mutex to protect data structures
56
57
XrdOucHash<XrdSysSemWait>
fSyncobjRepo
;
58
// each streamid counts on a condition
59
// variable to make the caller wait
60
// until some data is available
61
62
63
XrdSysSemWait *
GetSyncObjOrMakeOne
(
int
streamid);
64
65
int
MsgForStreamidCnt
(
int
streamid);
66
67
public
:
68
XrdClientInputBuffer
();
69
~XrdClientInputBuffer
();
70
71
inline
bool
IsMexEmpty
() {
return
(
MexSize
() == 0); }
72
inline
bool
IsSemEmpty
() {
return
(
SemSize
() == 0); }
73
inline
int
MexSize
() {
74
XrdSysMutexHelper
mtx
(
fMutex
);
75
return
fMsgQue
.
GetSize
();
76
}
77
int
PutMsg
(
XrdClientMessage
*
msg
);
78
inline
int
SemSize
() {
79
XrdSysMutexHelper
mtx
(
fMutex
);
80
return
fSyncobjRepo
.Num();
81
}
82
83
int
WipeStreamid
(
int
streamid);
84
85
XrdClientMessage
*
GetMsg
(
int
streamid,
int
secstimeout
);
86
};
87
#endif
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
XrdClientMessage.hh
XrdClientVector.hh
XrdSysMutexHelper
#define XrdSysMutexHelper
Definition
XrdSysToOuc.h:17
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
XrdClientInputBuffer
Definition
XrdClientInputBuffer.hh:48
XrdClientInputBuffer::MsgForStreamidCnt
int MsgForStreamidCnt(int streamid)
XrdClientInputBuffer::~XrdClientInputBuffer
~XrdClientInputBuffer()
XrdClientInputBuffer::fSyncobjRepo
XrdOucHash< XrdSysSemWait > fSyncobjRepo
Definition
XrdClientInputBuffer.hh:57
XrdClientInputBuffer::IsSemEmpty
bool IsSemEmpty()
Definition
XrdClientInputBuffer.hh:72
XrdClientInputBuffer::IsMexEmpty
bool IsMexEmpty()
Definition
XrdClientInputBuffer.hh:71
XrdClientInputBuffer::SemSize
int SemSize()
Definition
XrdClientInputBuffer.hh:78
XrdClientInputBuffer::fMsgQue
XrdClientVector< XrdClientMessage * > fMsgQue
Definition
XrdClientInputBuffer.hh:52
XrdClientInputBuffer::XrdClientInputBuffer
XrdClientInputBuffer()
XrdClientInputBuffer::GetSyncObjOrMakeOne
XrdSysSemWait * GetSyncObjOrMakeOne(int streamid)
XrdClientInputBuffer::GetMsg
XrdClientMessage * GetMsg(int streamid, int secstimeout)
XrdClientInputBuffer::fMsgIter
int fMsgIter
Definition
XrdClientInputBuffer.hh:53
XrdClientInputBuffer::MexSize
int MexSize()
Definition
XrdClientInputBuffer.hh:73
XrdClientInputBuffer::WipeStreamid
int WipeStreamid(int streamid)
XrdClientInputBuffer::fMutex
XrdSysRecMutex fMutex
Definition
XrdClientInputBuffer.hh:55
XrdClientInputBuffer::PutMsg
int PutMsg(XrdClientMessage *msg)
XrdClientMessage
Definition
XrdClientMessage.hh:49
XrdClientVector::GetSize
int GetSize() const
Definition
XrdClientVector.hh:142
proof
xrdinc
XrdClient
XrdClientInputBuffer.hh
ROOT tags/v6-32-12 - Reference Guide Generated on Tue Apr 8 2025 06:00:51 (GVA Time) using Doxygen 1.10.0