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
35class XrdCks;
36class XrdCksCalc;
37class XrdOucStream;
38class XrdSysError;
39class XrdSysPlugin;
40
48class XrdCks
49{
50public:
51
52//------------------------------------------------------------------------------
64//------------------------------------------------------------------------------
65virtual
66int Calc( const char *Pfn, XrdCksData &Cks, int doSet=1) = 0;
67
68//------------------------------------------------------------------------------
73//------------------------------------------------------------------------------
74virtual
75int Del( const char *Pfn, XrdCksData &Cks) = 0;
76
77//------------------------------------------------------------------------------
88//------------------------------------------------------------------------------
89virtual
90int Get( const char *Pfn, XrdCksData &Cks) = 0;
91
92//------------------------------------------------------------------------------
100//------------------------------------------------------------------------------
101virtual
102int Config(const char *Token, char *Line) = 0;
103
104//------------------------------------------------------------------------------
115//------------------------------------------------------------------------------
116virtual
117int Init(const char *ConfigFN, const char *DfltCalc=0) = 0;
118
119//------------------------------------------------------------------------------
132//------------------------------------------------------------------------------
133virtual
134char *List(const char *Pfn, char *Buff, int Blen, char Sep=' ') = 0;
135
136//------------------------------------------------------------------------------
145//------------------------------------------------------------------------------
146virtual const
147char *Name(int seqNum=0) = 0;
148
149//------------------------------------------------------------------------------
160//------------------------------------------------------------------------------
161virtual
162XrdCksCalc *Object(const char *name)
163{
164 (void)name;
165 return 0;
166}
167
168//------------------------------------------------------------------------------
175//------------------------------------------------------------------------------
176virtual
177int Size( const char *Name=0) = 0;
178
179//------------------------------------------------------------------------------
190//------------------------------------------------------------------------------
191virtual
192int Set( const char *Pfn, XrdCksData &Cks, int myTime=0) = 0;
193
194//------------------------------------------------------------------------------
206//------------------------------------------------------------------------------
207virtual
208int Ver( const char *Pfn, XrdCksData &Cks) = 0;
209
210//------------------------------------------------------------------------------
212//------------------------------------------------------------------------------
213
214 XrdCks(XrdSysError *erP) : eDest(erP) {}
215
216//------------------------------------------------------------------------------
218//------------------------------------------------------------------------------
219virtual ~XrdCks() {}
220
229protected:
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
Definition: XrdCksCalc.hh:40
Definition: XrdCksData.hh:38
Definition: XrdCks.hh:49
virtual int Get(const char *Pfn, XrdCksData &Cks)=0
virtual const char * Name(int seqNum=0)=0
virtual int Ver(const char *Pfn, XrdCksData &Cks)=0
virtual int Init(const char *ConfigFN, const char *DfltCalc=0)=0
virtual XrdCksCalc * Object(const char *name)
Definition: XrdCks.hh:162
virtual ~XrdCks()
Destructor.
Definition: XrdCks.hh:219
virtual int Config(const char *Token, char *Line)=0
XrdSysError * eDest
Definition: XrdCks.hh:231
virtual int Calc(const char *Pfn, XrdCksData &Cks, int doSet=1)=0
virtual int Set(const char *Pfn, XrdCksData &Cks, int myTime=0)=0
virtual int Size(const char *Name=0)=0
XrdCks(XrdSysError *erP)
Constructor.
Definition: XrdCks.hh:214
virtual int Del(const char *Pfn, XrdCksData &Cks)=0
virtual char * List(const char *Pfn, char *Buff, int Blen, char Sep=' ')=0
Definition: XrdOucStream.hh:46
Definition: XrdSysError.hh:90
Definition: XrdSysPlugin.hh:53