xrootd
Loading...
Searching...
No Matches
XrdCks.hh
Go to the documentation of this file.
1#ifndef __XRDCKS_HH__
2#define __XRDCKS_HH__
3/******************************************************************************/
4/* */
5/* X r d C k s . h h */
6/* */
7/* (c) 2011 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
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#include "XrdCks/XrdCksData.hh"
34
35class XrdCks;
36class XrdCksCalc;
37class XrdOucStream;
38class XrdSysError;
39class XrdSysPlugin;
40
48/******************************************************************************/
49/* X r d C k s P C B */
50/******************************************************************************/
56{
57public:
58
59//------------------------------------------------------------------------------
63//------------------------------------------------------------------------------
64
65virtual void Info(long long fsize, long long csbytes);
66
67long long rsvd;
68
69 XrdCksPCB() : rsvd(0) {}
70virtual ~XrdCksPCB() {}
71};
72
73/******************************************************************************/
74/* X r d C k s */
75/******************************************************************************/
76//------------------------------------------------------------------------------
89//------------------------------------------------------------------------------
90
91class XrdCks
92{
93public:
94
95//------------------------------------------------------------------------------
109//------------------------------------------------------------------------------
110virtual
111int Calc( const char *Xfn, XrdCksData &Cks, int doSet=1) = 0;
112
113virtual
114int Calc( const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP, int doSet=1)
115 {(void)pcbP; return Calc(Xfn, Cks, doSet);}
116
117//------------------------------------------------------------------------------
125//------------------------------------------------------------------------------
126virtual
127int Del( const char *Xfn, XrdCksData &Cks) = 0;
128
129//------------------------------------------------------------------------------
140//------------------------------------------------------------------------------
141virtual
142int Get( const char *Xfn, XrdCksData &Cks) = 0;
143
144//------------------------------------------------------------------------------
152//------------------------------------------------------------------------------
153virtual
154int Config(const char *Token, char *Line) = 0;
155
156//------------------------------------------------------------------------------
167//------------------------------------------------------------------------------
168virtual
169int Init(const char *ConfigFN, const char *DfltCalc=0) = 0;
170
171//------------------------------------------------------------------------------
184//------------------------------------------------------------------------------
185virtual
186char *List(const char *Xfn, char *Buff, int Blen, char Sep=' ') = 0;
187
188//------------------------------------------------------------------------------
197//------------------------------------------------------------------------------
198virtual const
199char *Name(int seqNum=0) = 0;
200
201//------------------------------------------------------------------------------
212//------------------------------------------------------------------------------
213virtual
214XrdCksCalc *Object(const char *name)
215{
216 (void)name;
217 return 0;
218}
219
220//------------------------------------------------------------------------------
227//------------------------------------------------------------------------------
228virtual
229int Size( const char *Name=0) = 0;
230
231//------------------------------------------------------------------------------
242//------------------------------------------------------------------------------
243virtual
244int Set( const char *Xfn, XrdCksData &Cks, int myTime=0) = 0;
245
246//------------------------------------------------------------------------------
260//------------------------------------------------------------------------------
261virtual
262int Ver( const char *Xfn, XrdCksData &Cks) = 0;
263
264virtual
265int Ver( const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP)
266 {(void)pcbP; return Ver(Xfn, Cks);}
267
268//------------------------------------------------------------------------------
270//------------------------------------------------------------------------------
271
272 XrdCks(XrdSysError *erP) : eDest(erP) {}
273
274//------------------------------------------------------------------------------
276//------------------------------------------------------------------------------
277virtual ~XrdCks() {}
278
287protected:
288
290};
291
292/******************************************************************************/
293/* X r d C k s I n i t */
294/******************************************************************************/
295
296#define XRDCKSINITPARMS XrdSysError *, const char *, const char *
297
298//------------------------------------------------------------------------------
316//------------------------------------------------------------------------------
317
323//------------------------------------------------------------------------------
329//------------------------------------------------------------------------------
330
336#endif
Definition XrdCksCalc.hh:40
Definition XrdCksData.hh:38
Definition XrdCks.hh:56
long long rsvd
Definition XrdCks.hh:67
virtual void Info(long long fsize, long long csbytes)
XrdCksPCB()
Definition XrdCks.hh:69
virtual ~XrdCksPCB()
Definition XrdCks.hh:70
Definition XrdCks.hh:92
virtual int Ver(const char *Xfn, XrdCksData &Cks)=0
virtual const char * Name(int seqNum=0)=0
virtual int Calc(const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP, int doSet=1)
Definition XrdCks.hh:114
virtual int Init(const char *ConfigFN, const char *DfltCalc=0)=0
virtual XrdCksCalc * Object(const char *name)
Definition XrdCks.hh:214
virtual int Get(const char *Xfn, XrdCksData &Cks)=0
virtual int Del(const char *Xfn, XrdCksData &Cks)=0
virtual ~XrdCks()
Destructor.
Definition XrdCks.hh:277
virtual int Config(const char *Token, char *Line)=0
XrdSysError * eDest
Definition XrdCks.hh:289
virtual char * List(const char *Xfn, char *Buff, int Blen, char Sep=' ')=0
virtual int Ver(const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP)
Definition XrdCks.hh:265
virtual int Size(const char *Name=0)=0
virtual int Set(const char *Xfn, XrdCksData &Cks, int myTime=0)=0
XrdCks(XrdSysError *erP)
Constructor.
Definition XrdCks.hh:272
virtual int Calc(const char *Xfn, XrdCksData &Cks, int doSet=1)=0
Definition XrdOucStream.hh:47
Definition XrdSysError.hh:90
Definition XrdSysPlugin.hh:53