xrootd
XrdPssCks.hh
Go to the documentation of this file.
1 #ifndef __XRDPSSCKS_HH__
2 #define __XRDPSSCKS_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d P s s 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 <errno.h>
34 
35 #include "XrdCks/XrdCks.hh"
36 #include "XrdCks/XrdCksData.hh"
37 
38 class XrdSysError;
39 
40 class XrdPssCks : public XrdCks
41 {
42 public:
43 
44 virtual int Calc( const char *Pfn, XrdCksData &Cks, int doSet=1)
45  {return Get(Pfn, Cks);}
46 
47 virtual int Del( const char *Pfn, XrdCksData &Cks)
48  {return -ENOTSUP;}
49 
50 virtual int Get( const char *Pfn, XrdCksData &Cks);
51 
52 virtual int Config(const char *Token, char *Line) {return 1;}
53 
54 virtual int Init(const char *ConfigFN, const char *DfltCalc=0);
55 
56 virtual char *List(const char *Pfn, char *Buff, int Blen, char Sep=' ')
57  {return 0;}
58 
59 virtual const char *Name(int seqNum=0);
60 
61 virtual int Size( const char *Name=0);
62 
63 virtual int Set( const char *Pfn, XrdCksData &Cks, int myTime=0)
64  {return -ENOTSUP;}
65 
66 virtual int Ver( const char *Pfn, XrdCksData &Cks);
67 
68  XrdPssCks(XrdSysError *erP);
69 virtual ~XrdPssCks() {}
70 
71 private:
72 
73 struct csInfo
75  int Len;
76  csInfo() : Len(0) {memset(Name, 0, sizeof(Name));}
77  };
78 
79 csInfo *Find(const char *Name);
80 
81 static const int csMax = 4;
83 int csLast;
84 };
85 #endif
int csLast
Definition: XrdPssCks.hh:83
virtual char * List(const char *Pfn, char *Buff, int Blen, char Sep=' ')
Definition: XrdPssCks.hh:56
csInfo()
Definition: XrdPssCks.hh:76
Definition: XrdCks.hh:91
virtual int Size(const char *Name=0)
virtual int Config(const char *Token, char *Line)
Definition: XrdPssCks.hh:52
XrdPssCks(XrdSysError *erP)
csInfo * Find(const char *Name)
virtual int Get(const char *Pfn, XrdCksData &Cks)
virtual int Calc(const char *Pfn, XrdCksData &Cks, int doSet=1)
Definition: XrdPssCks.hh:44
Definition: XrdCksData.hh:37
Definition: XrdSysError.hh:89
int Len
Definition: XrdPssCks.hh:75
Definition: XrdPssCks.hh:73
char Name[XrdCksData::NameSize]
Definition: XrdPssCks.hh:74
virtual ~XrdPssCks()
Definition: XrdPssCks.hh:69
virtual int Ver(const char *Pfn, XrdCksData &Cks)
csInfo csTab[csMax]
Definition: XrdPssCks.hh:82
virtual int Init(const char *ConfigFN, const char *DfltCalc=0)
virtual int Del(const char *Pfn, XrdCksData &Cks)
Definition: XrdPssCks.hh:47
virtual int Set(const char *Pfn, XrdCksData &Cks, int myTime=0)
Definition: XrdPssCks.hh:63
virtual const char * Name(int seqNum=0)
static const int NameSize
Definition: XrdCksData.hh:41
static const int csMax
Definition: XrdPssCks.hh:81
Definition: XrdPssCks.hh:40