00001 // $Id: XrdSutRndm.hh 22437 2008-03-04 14:35:16Z rdm $ 00002 #ifndef __SUT_RNDM_H__ 00003 #define __SUT_RNDM_H__ 00004 /******************************************************************************/ 00005 /* */ 00006 /* X r d S u t R n d m . h h */ 00007 /* */ 00008 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00009 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00010 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00011 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00012 /******************************************************************************/ 00013 00014 #ifndef __SUT_AUX_H__ 00015 #include <XrdSut/XrdSutAux.hh> 00016 #endif 00017 00018 /******************************************************************************/ 00019 /* */ 00020 /* Provider of random bunches of bits */ 00021 /* */ 00022 /******************************************************************************/ 00023 00024 class XrdOucString; 00025 00026 class XrdSutRndm { 00027 00028 public: 00029 static bool fgInit; 00030 00031 XrdSutRndm() { if (!fgInit) fgInit = XrdSutRndm::Init(); } 00032 virtual ~XrdSutRndm() { } 00033 00034 // Initializer 00035 static bool Init(bool force = 0); 00036 00037 // Buffer provider 00038 static char *GetBuffer(int len, int opt = -1); 00039 // String provider 00040 static int GetString(int opt, int len, XrdOucString &s); 00041 static int GetString(const char *copt, int len, XrdOucString &s); 00042 // Integer providers 00043 static unsigned int GetUInt(); 00044 // Random Tag 00045 static int GetRndmTag(XrdOucString &rtag); 00046 } 00047 ; 00048 00049 #endif 00050