Loading...
Searching...
No Matches
XrdSsiRespInfo.hh
Go to the documentation of this file.
#ifndef __XRDSSIRESPINFO_HH__
#define __XRDSSIRESPINFO_HH__
/******************************************************************************/
/* */
/* X r d S s i R e s p I n f o . h h */
/* */
/* (c) 2014 by the Board of Trustees of the Leland Stanford, Jr., University */
/* Produced by Andrew Hanushevsky for Stanford University under contract */
/* DE-AC02-76-SFO0515 with the Department of Energy */
/* */
/* This file is part of the XRootD software suite. */
/* */
/* XRootD is free software: you can redistribute it and/or modify it under */
/* the terms of the GNU Lesser General Public License as published by the */
/* Free Software Foundation, either version 3 of the License, or (at your */
/* option) any later version. */
/* */
/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
/* License for more details. */
/* */
/* You should have received a copy of the GNU Lesser General Public License */
/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
/* */
/* The copyright holder's institutional names and contributor's names may not */
/* be used to endorse or promote products derived from this software without */
/* specific prior written permission of the institution or contributor. */
/******************************************************************************/
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
class XrdSsiStream;
struct XrdSsiRespInfo
{union {const char *buff;
const char *eMsg;
long long fsize;
XrdSsiStream *strmP;
};
union { int blen;
int eNum;
int fdnum;
};
int mdlen;
const char *mdata;
enum Resp_t {isNone = 0, isData, isError, isFile, isStream, isHandle};
Resp_t rType;
inline void Init() {fsize=0; blen=0; mdlen=0; mdata=0; rType=isNone;}
const char *State() const {if (rType == isData ) return "isData";
if (rType == isError ) return "isError";
if (rType == isHandle) return "isHandle";
if (rType == isFile ) return "isFile";
if (rType == isStream) return "isStream";
if (rType == isNone ) return "isNone";
return "isUndef";
}
XrdSsiRespInfo() {Init();}
~XrdSsiRespInfo() {}
};
/******************************************************************************/
/* X r d S s i R e s p M s g */
/******************************************************************************/
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
class XrdSsiRespInfoMsg
{
public:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
inline char *GetMsg(int &mlen) {mlen = msgLen; return msgBuf;}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
virtual void RecycleMsg(bool sent=true) = 0;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
XrdSsiRespInfoMsg(char *msgP, int mlen)
: msgBuf(msgP), msgLen(mlen) {}
protected:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
virtual ~XrdSsiRespInfoMsg() {}
char *msgBuf;
int msgLen;
};
#endif
XrdSsiRespInfo.__unnamed0__::eMsg
const char * eMsg
->msg text when rType == isError
XrdSsiRespInfo.__unnamed1__::blen
int blen
XrdSsiRespInfo.__unnamed1__::eNum
int eNum
errno When rType == isError
XrdSsiRespInfo.__unnamed0__::fsize
long long fsize
->file size when rType == isFile
XrdSsiRespInfo.__unnamed0__::buff
const char * buff
XrdSsiRespInfo.__unnamed0__::strmP
XrdSsiStream * strmP
->SsiStream when rType == isStream
XrdSsiRespInfo.__unnamed1__::fdnum
int fdnum
filedesc When rType == isFile
XrdSsiRespInfoMsg::GetMsg
char * GetMsg(int &mlen)
Definition XrdSsiRespInfo.hh:99
XrdSsiRespInfoMsg::msgLen
int msgLen
Definition XrdSsiRespInfo.hh:129
XrdSsiRespInfoMsg::msgBuf
char * msgBuf
Definition XrdSsiRespInfo.hh:128
XrdSsiRespInfoMsg::~XrdSsiRespInfoMsg
virtual ~XrdSsiRespInfoMsg()
Destructor. This object may not be deleted. Use Recycle() instead.
Definition XrdSsiRespInfo.hh:126
XrdSsiRespInfoMsg::RecycleMsg
virtual void RecycleMsg(bool sent=true)=0
XrdSsiRespInfoMsg::XrdSsiRespInfoMsg
XrdSsiRespInfoMsg(char *msgP, int mlen)
Definition XrdSsiRespInfo.hh:117
XrdSsiStream
Definition XrdSsiStream.hh:54
XrdSsiRespInfo::Resp_t
Resp_t
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::isHandle
@ isHandle
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::isNone
@ isNone
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::isFile
@ isFile
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::isError
@ isError
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::isStream
@ isStream
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::isData
@ isData
Definition XrdSsiRespInfo.hh:58
XrdSsiRespInfo::Init
void Init()
Definition XrdSsiRespInfo.hh:61
XrdSsiRespInfo::State
const char * State() const
Definition XrdSsiRespInfo.hh:63
XrdSsiRespInfo::XrdSsiRespInfo
XrdSsiRespInfo()
Definition XrdSsiRespInfo.hh:72
XrdSsiRespInfo::rType
Resp_t rType
Definition XrdSsiRespInfo.hh:59
XrdSsiRespInfo::mdlen
int mdlen
Metadata length.
Definition XrdSsiRespInfo.hh:55
XrdSsiRespInfo::mdata
const char * mdata
-> Metadata about response.
Definition XrdSsiRespInfo.hh:56
XrdSsiRespInfo::~XrdSsiRespInfo
~XrdSsiRespInfo()
Definition XrdSsiRespInfo.hh:73