From 293524139f8ca0b6fc365c03557ab988e4a3533a Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Mon, 21 Sep 2015 14:01:37 +0200 Subject: [PATCH] Do not include private header in public header --- proof/proofx/inc/TXSocket.h | 24 +++++++------- proof/proofx/src/TXProofMgr.cxx | 2 ++ proof/proofx/src/TXSocket.cxx | 58 +++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 13 deletions(-) diff --git a/proof/proofx/inc/TXSocket.h b/proof/proofx/inc/TXSocket.h index 8917e4e1d233c..01495f90bf411 100644 --- a/proof/proofx/inc/TXSocket.h +++ b/proof/proofx/inc/TXSocket.h @@ -43,8 +43,8 @@ #ifndef ROOT_TSocket #include "TSocket.h" #endif -#ifndef ROOT_XrdProofConn -#include "XrdProofConn.h" +#ifndef __XPTYPES_H +#include "XProtocol/XPtypes.hh" #endif #ifndef XRC_UNSOLMSG_H #include "XrdClient/XrdClientUnsolMsg.hh" @@ -58,6 +58,7 @@ class TXSockPipe; class TXHandler; class TXSocketHandler; class XrdClientMessage; +class XrdProofConn; // To transmit info to Handlers typedef struct { @@ -140,7 +141,7 @@ friend class TXUnixSocket; void PostMsg(Int_t type, const char *msg = 0); // Auxilliary - Int_t GetLowSocket() const { return (fConn ? fConn->GetLowSocket() : -1); } + Int_t GetLowSocket() const; static void SetLocation(const char *loc = ""); // Set location string @@ -170,13 +171,13 @@ friend class TXUnixSocket; virtual Int_t GetClientID() const { return -1; } virtual Int_t GetClientIDSize() const { return 1; } - Int_t GetLogConnID() const { return (fConn ? fConn->GetLogConnID() : -1); } - Int_t GetOpenError() const { return (fConn ? fConn->GetOpenError() : -1); } - Int_t GetServType() const { return (fConn ? fConn->GetServType() : -1); } - Int_t GetSessionID() const { return (fConn ? fConn->GetSessionID() : -1); } - Int_t GetXrdProofdVersion() const { return fXrdProofdVersion; } + Int_t GetLogConnID() const; + Int_t GetOpenError() const; + Int_t GetServType() const; + Int_t GetSessionID() const; + Int_t GetXrdProofdVersion() const; - Bool_t IsValid() const { return (fConn ? (fConn->IsValid()) : kFALSE); } + Bool_t IsValid() const; Bool_t IsServProofd(); virtual void RemoveClientID() { } virtual void SetClientID(Int_t) { } @@ -215,10 +216,7 @@ friend class TXUnixSocket; void SendUrgent(Int_t type, Int_t int1, Int_t int2); // Interrupt the low level socket - inline void SetInterrupt(Bool_t i = kTRUE) { R__LOCKGUARD(fAMtx); - fRDInterrupt = i; - if (i && fConn) fConn->SetInterrupt(); - if (i && fAWait) fASem.Post(); } + void SetInterrupt(Bool_t i = kTRUE); inline Bool_t IsInterrupt() { R__LOCKGUARD(fAMtx); return fRDInterrupt; } // Set / Check async msg queue waiting status inline void SetAWait(Bool_t w = kTRUE) { R__LOCKGUARD(fAMtx); fAWait = w; } diff --git a/proof/proofx/src/TXProofMgr.cxx b/proof/proofx/src/TXProofMgr.cxx index e9c23b2b2e0c3..86bbbf42928d2 100644 --- a/proof/proofx/src/TXProofMgr.cxx +++ b/proof/proofx/src/TXProofMgr.cxx @@ -40,6 +40,8 @@ #include "TSysEvtHandler.h" #include "XProofProtocol.h" +#include "XrdProofConn.h" + ClassImp(TXProofMgr) // diff --git a/proof/proofx/src/TXSocket.cxx b/proof/proofx/src/TXSocket.cxx index 86dba273c7f5f..6da499617e67a 100644 --- a/proof/proofx/src/TXSocket.cxx +++ b/proof/proofx/src/TXSocket.cxx @@ -928,6 +928,48 @@ void TXSocket::PostMsg(Int_t type, const char *msg) return; } +//////////////////////////////////////////////////////////////////////////////// + +Int_t TXSocket::GetLogConnID() const +{ + return (fConn ? fConn->GetLogConnID() : -1); +} + +//////////////////////////////////////////////////////////////////////////////// + +Int_t TXSocket::GetOpenError() const +{ + return (fConn ? fConn->GetOpenError() : -1); +} + +//////////////////////////////////////////////////////////////////////////////// + +Int_t TXSocket::GetServType() const +{ + return (fConn ? fConn->GetServType() : -1); +} + +//////////////////////////////////////////////////////////////////////////////// + +Int_t TXSocket::GetSessionID() const +{ + return (fConn ? fConn->GetSessionID() : -1); +} + +//////////////////////////////////////////////////////////////////////////////// + +Int_t TXSocket::GetXrdProofdVersion() const +{ + return fXrdProofdVersion; +} + +//////////////////////////////////////////////////////////////////////////////// + +Bool_t TXSocket::IsValid() const +{ + return (fConn ? (fConn->IsValid()) : kFALSE); +} + //////////////////////////////////////////////////////////////////////////////// /// Return kTRUE if the remote server is a 'proofd' @@ -1649,6 +1691,16 @@ Int_t TXSocket::SendInterrupt(Int_t type) return -1; } +//////////////////////////////////////////////////////////////////////////////// + +void TXSocket::SetInterrupt(Bool_t i) +{ + R__LOCKGUARD(fAMtx); + fRDInterrupt = i; + if (i && fConn) fConn->SetInterrupt(); + if (i && fAWait) fASem.Post(); +} + //////////////////////////////////////////////////////////////////////////////// /// Send a TMessage object. Returns the number of bytes in the TMessage /// that were sent and -1 in case of error. @@ -1939,6 +1991,12 @@ void TXSocket::SendUrgent(Int_t type, Int_t int1, Int_t int2) return; } +//////////////////////////////////////////////////////////////////////////////// + +Int_t TXSocket::GetLowSocket() const { + return (fConn ? fConn->GetLowSocket() : -1); +} + //////////////////////////////////////////////////////////////////////////////// /// Init environment variables for XrdClient