Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-08 10:33:34

0001 #ifndef __SUT_BUCKET_H__
0002 #define __SUT_BUCKET_H__
0003 /******************************************************************************/
0004 /*                                                                            */
0005 /*                      X r d S u t B u c k e t . h h                         */
0006 /*                                                                            */
0007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
0008 /*   Produced by Gerri Ganis for CERN                                         */
0009 /*                                                                            */
0010 /* This file is part of the XRootD software suite.                            */
0011 /*                                                                            */
0012 /* XRootD is free software: you can redistribute it and/or modify it under    */
0013 /* the terms of the GNU Lesser General Public License as published by the     */
0014 /* Free Software Foundation, either version 3 of the License, or (at your     */
0015 /* option) any later version.                                                 */
0016 /*                                                                            */
0017 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
0018 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
0019 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
0020 /* License for more details.                                                  */
0021 /*                                                                            */
0022 /* You should have received a copy of the GNU Lesser General Public License   */
0023 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
0024 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
0025 /*                                                                            */
0026 /* The copyright holder's institutional names and contributor's names may not */
0027 /* be used to endorse or promote products derived from this software without  */
0028 /* specific prior written permission of the institution or contributor.       */
0029 /******************************************************************************/
0030 
0031 #ifndef __SUT_STRING_H__
0032 #include "XrdSut/XrdSutAux.hh"
0033 #endif
0034 
0035 class XrdOucString;
0036 
0037 /******************************************************************************/
0038 /*                                                                            */
0039 /*  Unit for information exchange                                             */
0040 /*                                                                            */
0041 /******************************************************************************/
0042 
0043 class XrdSutBucket
0044 {
0045 public:
0046    kXR_int32   type;
0047    kXR_int32   size;
0048    char       *buffer;
0049 
0050    XrdSutBucket(char *bp=0, int sz=0, int ty=0);
0051    XrdSutBucket(XrdOucString &s, int ty=0);
0052    XrdSutBucket(XrdSutBucket &b);
0053    virtual ~XrdSutBucket() {if (membuf) delete[] membuf;}
0054 
0055    void Update(char *nb = 0, int ns = 0, int ty = 0); // Uses 'nb'
0056    int Update(XrdOucString &s, int ty = 0);
0057    int SetBuf(const char *nb = 0, int ns = 0);         // Duplicates 'nb'
0058 
0059    void Dump(int opt = 1);
0060    void ToString(XrdOucString &s);
0061 
0062    // Equality operator
0063    int operator==(const XrdSutBucket &b);
0064 
0065    // Inequality operator
0066    int operator!=(const XrdSutBucket &b) { return !(*this == b); }
0067 
0068 private:
0069    char *membuf;
0070 };
0071 
0072 #endif
0073