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 class XrdCks
49 {
50 public:
51 
52 //------------------------------------------------------------------------------
64 //------------------------------------------------------------------------------
65 virtual
66 int Calc( const char *Pfn, XrdCksData &Cks, int doSet=1) = 0;
67 
68 //------------------------------------------------------------------------------
73 //------------------------------------------------------------------------------
74 virtual
75 int Del( const char *Pfn, XrdCksData &Cks) = 0;
76 
77 //------------------------------------------------------------------------------
88 //------------------------------------------------------------------------------
89 virtual
90 int Get( const char *Pfn, XrdCksData &Cks) = 0;
91 
92 //------------------------------------------------------------------------------
100 //------------------------------------------------------------------------------
101 virtual
102 int Config(const char *Token, char *Line) = 0;
103 
104 //------------------------------------------------------------------------------
115 //------------------------------------------------------------------------------
116 virtual
117 int Init(const char *ConfigFN, const char *DfltCalc=0) = 0;
118 
119 //------------------------------------------------------------------------------
132 //------------------------------------------------------------------------------
133 virtual
134 char *List(const char *Pfn, char *Buff, int Blen, char Sep=' ') = 0;
135 
136 //------------------------------------------------------------------------------
145 //------------------------------------------------------------------------------
146 virtual const
147 char *Name(int seqNum=0) = 0;
148 
149 //------------------------------------------------------------------------------
160 //------------------------------------------------------------------------------
161 virtual
162 XrdCksCalc *Object(const char *name)
163 {
164  (void)name;
165  return 0;
166 }
167 
168 //------------------------------------------------------------------------------
175 //------------------------------------------------------------------------------
176 virtual
177 int Size( const char *Name=0) = 0;
178 
179 //------------------------------------------------------------------------------
190 //------------------------------------------------------------------------------
191 virtual
192 int Set( const char *Pfn, XrdCksData &Cks, int myTime=0) = 0;
193 
194 //------------------------------------------------------------------------------
206 //------------------------------------------------------------------------------
207 virtual
208 int Ver( const char *Pfn, XrdCksData &Cks) = 0;
209 
210 //------------------------------------------------------------------------------
212 //------------------------------------------------------------------------------
213 
214  XrdCks(XrdSysError *erP) : eDest(erP) {}
215 
216 //------------------------------------------------------------------------------
218 //------------------------------------------------------------------------------
219 virtual ~XrdCks() {}
220 
229 protected:
230 
232 };
233 
234 /******************************************************************************/
235 /* X r d C k s I n i t */
236 /******************************************************************************/
237 
238 #define XRDCKSINITPARMS XrdSysError *, const char *, const char *
239 
240 //------------------------------------------------------------------------------
258 //------------------------------------------------------------------------------
259 
265 //------------------------------------------------------------------------------
271 //------------------------------------------------------------------------------
272 
278 #endif
virtual const char * Name(int seqNum=0)=0
virtual int Del(const char *Pfn, XrdCksData &Cks)=0
virtual ~XrdCks()
Destructor.
Definition: XrdCks.hh:219
Definition: XrdCks.hh:48
virtual char * List(const char *Pfn, char *Buff, int Blen, char Sep=' ')=0
Definition: XrdOucStream.hh:43
virtual int Config(const char *Token, char *Line)=0
virtual int Get(const char *Pfn, XrdCksData &Cks)=0
Definition: XrdCksData.hh:35
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 Size(const char *Name=0)=0
XrdCks(XrdSysError *erP)
Constructor.
Definition: XrdCks.hh:214
virtual int Set(const char *Pfn, XrdCksData &Cks, int myTime=0)=0
virtual XrdCksCalc * Object(const char *name)
Definition: XrdCks.hh:162
XrdSysError * eDest
Definition: XrdCks.hh:231