XRootD
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 
35 class XrdCks;
36 class XrdCksCalc;
37 class XrdOucStream;
38 class XrdSysError;
39 class XrdSysPlugin;
40 
48 /******************************************************************************/
49 /* X r d C k s P C B */
50 /******************************************************************************/
55 class XrdCksPCB
56 {
57 public:
58 
59 //------------------------------------------------------------------------------
63 //------------------------------------------------------------------------------
64 
65 virtual void Info(long long fsize, long long csbytes);
66 
67 long long rsvd;
68 
69  XrdCksPCB() : rsvd(0) {}
70 virtual ~XrdCksPCB() {}
71 };
72 
73 /******************************************************************************/
74 /* X r d C k s */
75 /******************************************************************************/
76 //------------------------------------------------------------------------------
89 //------------------------------------------------------------------------------
90 
91 class XrdCks
92 {
93 public:
94 
95 //------------------------------------------------------------------------------
109 //------------------------------------------------------------------------------
110 virtual
111 int Calc( const char *Xfn, XrdCksData &Cks, int doSet=1) = 0;
112 
113 virtual
114 int Calc( const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP, int doSet=1)
115  {(void)pcbP; return Calc(Xfn, Cks, doSet);}
116 
117 //------------------------------------------------------------------------------
125 //------------------------------------------------------------------------------
126 virtual
127 int Del( const char *Xfn, XrdCksData &Cks) = 0;
128 
129 //------------------------------------------------------------------------------
140 //------------------------------------------------------------------------------
141 virtual
142 int Get( const char *Xfn, XrdCksData &Cks) = 0;
143 
144 //------------------------------------------------------------------------------
152 //------------------------------------------------------------------------------
153 virtual
154 int Config(const char *Token, char *Line) = 0;
155 
156 //------------------------------------------------------------------------------
167 //------------------------------------------------------------------------------
168 virtual
169 int Init(const char *ConfigFN, const char *DfltCalc=0) = 0;
170 
171 //------------------------------------------------------------------------------
184 //------------------------------------------------------------------------------
185 virtual
186 char *List(const char *Xfn, char *Buff, int Blen, char Sep=' ') = 0;
187 
188 //------------------------------------------------------------------------------
197 //------------------------------------------------------------------------------
198 virtual const
199 char *Name(int seqNum=0) = 0;
200 
201 //------------------------------------------------------------------------------
212 //------------------------------------------------------------------------------
213 virtual
214 XrdCksCalc *Object(const char *name)
215 {
216  (void)name;
217  return 0;
218 }
219 
220 //------------------------------------------------------------------------------
227 //------------------------------------------------------------------------------
228 virtual
229 int Size( const char *Name=0) = 0;
230 
231 //------------------------------------------------------------------------------
242 //------------------------------------------------------------------------------
243 virtual
244 int Set( const char *Xfn, XrdCksData &Cks, int myTime=0) = 0;
245 
246 //------------------------------------------------------------------------------
260 //------------------------------------------------------------------------------
261 virtual
262 int Ver( const char *Xfn, XrdCksData &Cks) = 0;
263 
264 virtual
265 int 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 //------------------------------------------------------------------------------
277 virtual ~XrdCks() {}
278 
287 protected:
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
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 const char * Name(int seqNum=0)=0
virtual int Ver(const char *Xfn, XrdCksData &Cks)=0
virtual char * List(const char *Xfn, char *Buff, int Blen, char Sep=' ')=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 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 int Ver(const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP)
Definition: XrdCks.hh:265
virtual XrdCksCalc * Object(const char *name)
Definition: XrdCks.hh:214
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