xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
77 class XrdCks
78 {
79 public:
80 
81 //------------------------------------------------------------------------------
95 //------------------------------------------------------------------------------
96 virtual
97 int Calc( const char *Pfn, XrdCksData &Cks, int doSet=1) = 0;
98 
99 virtual
100 int Calc( const char *Pfn, XrdCksData &Cks, XrdCksPCB *pcbP, int doSet=1)
101  {(void)pcbP; return Calc(Pfn, Cks, doSet);}
102 
103 //------------------------------------------------------------------------------
108 //------------------------------------------------------------------------------
109 virtual
110 int Del( const char *Pfn, XrdCksData &Cks) = 0;
111 
112 //------------------------------------------------------------------------------
123 //------------------------------------------------------------------------------
124 virtual
125 int Get( const char *Pfn, XrdCksData &Cks) = 0;
126 
127 //------------------------------------------------------------------------------
135 //------------------------------------------------------------------------------
136 virtual
137 int Config(const char *Token, char *Line) = 0;
138 
139 //------------------------------------------------------------------------------
150 //------------------------------------------------------------------------------
151 virtual
152 int Init(const char *ConfigFN, const char *DfltCalc=0) = 0;
153 
154 //------------------------------------------------------------------------------
167 //------------------------------------------------------------------------------
168 virtual
169 char *List(const char *Pfn, char *Buff, int Blen, char Sep=' ') = 0;
170 
171 //------------------------------------------------------------------------------
180 //------------------------------------------------------------------------------
181 virtual const
182 char *Name(int seqNum=0) = 0;
183 
184 //------------------------------------------------------------------------------
195 //------------------------------------------------------------------------------
196 virtual
197 XrdCksCalc *Object(const char *name)
198 {
199  (void)name;
200  return 0;
201 }
202 
203 //------------------------------------------------------------------------------
210 //------------------------------------------------------------------------------
211 virtual
212 int Size( const char *Name=0) = 0;
213 
214 //------------------------------------------------------------------------------
225 //------------------------------------------------------------------------------
226 virtual
227 int Set( const char *Pfn, XrdCksData &Cks, int myTime=0) = 0;
228 
229 //------------------------------------------------------------------------------
243 //------------------------------------------------------------------------------
244 virtual
245 int Ver( const char *Pfn, XrdCksData &Cks) = 0;
246 
247 virtual
248 int Ver( const char *Pfn, XrdCksData &Cks, XrdCksPCB *pcbP)
249  {(void)pcbP; return Ver(Pfn, Cks);}
250 
251 //------------------------------------------------------------------------------
253 //------------------------------------------------------------------------------
254 
255  XrdCks(XrdSysError *erP) : eDest(erP) {}
256 
257 //------------------------------------------------------------------------------
259 //------------------------------------------------------------------------------
260 virtual ~XrdCks() {}
261 
270 protected:
271 
273 };
274 
275 /******************************************************************************/
276 /* X r d C k s I n i t */
277 /******************************************************************************/
278 
279 #define XRDCKSINITPARMS XrdSysError *, const char *, const char *
280 
281 //------------------------------------------------------------------------------
299 //------------------------------------------------------------------------------
300 
306 //------------------------------------------------------------------------------
312 //------------------------------------------------------------------------------
313 
319 #endif
virtual const char * Name(int seqNum=0)=0
virtual int Del(const char *Pfn, XrdCksData &Cks)=0
virtual ~XrdCks()
Destructor.
Definition: XrdCks.hh:260
Definition: XrdCks.hh:77
virtual char * List(const char *Pfn, char *Buff, int Blen, char Sep=' ')=0
Definition: XrdOucStream.hh:46
virtual int Calc(const char *Pfn, XrdCksData &Cks, XrdCksPCB *pcbP, int doSet=1)
Definition: XrdCks.hh:100
virtual int Config(const char *Token, char *Line)=0
virtual int Get(const char *Pfn, XrdCksData &Cks)=0
Definition: XrdCksData.hh:37
Definition: XrdSysError.hh:89
Definition: XrdSysPlugin.hh:52
Definition: XrdCksCalc.hh:39
virtual int Calc(const char *Pfn, XrdCksData &Cks, int doSet=1)=0
virtual int Init(const char *ConfigFN, const char *DfltCalc=0)=0
virtual int Ver(const char *Pfn, XrdCksData &Cks)=0
virtual int Ver(const char *Pfn, XrdCksData &Cks, XrdCksPCB *pcbP)
Definition: XrdCks.hh:248
XrdCksPCB()
Definition: XrdCks.hh:69
virtual ~XrdCksPCB()
Definition: XrdCks.hh:70
Definition: XrdCks.hh:55
virtual int Size(const char *Name=0)=0
virtual void Info(long long fsize, long long csbytes)
XrdCks(XrdSysError *erP)
Constructor.
Definition: XrdCks.hh:255
virtual int Set(const char *Pfn, XrdCksData &Cks, int myTime=0)=0
virtual XrdCksCalc * Object(const char *name)
Definition: XrdCks.hh:197
XrdSysError * eDest
Definition: XrdCks.hh:272
long long rsvd
Definition: XrdCks.hh:67