XrdClFile.hh

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
00003 // Author: Lukasz Janyst <ljanyst@cern.ch>
00004 //------------------------------------------------------------------------------
00005 // XRootD is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU Lesser General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // XRootD is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with XRootD.  If not, see <http://www.gnu.org/licenses/>.
00017 //------------------------------------------------------------------------------
00018 
00019 #ifndef __XRD_CL_FILE_HH__
00020 #define __XRD_CL_FILE_HH__
00021 
00022 #include "XrdCl/XrdClFileSystem.hh"
00023 #include "XrdCl/XrdClXRootDResponses.hh"
00024 #include <stdint.h>
00025 #include <string>
00026 #include <vector>
00027 
00028 namespace XrdCl
00029 {
00030   class FileStateHandler;
00031 
00032   //----------------------------------------------------------------------------
00034   //----------------------------------------------------------------------------
00035   class File
00036   {
00037     public:
00038       //------------------------------------------------------------------------
00040       //------------------------------------------------------------------------
00041       File();
00042 
00043       //------------------------------------------------------------------------
00045       //------------------------------------------------------------------------
00046       virtual ~File();
00047 
00048       //------------------------------------------------------------------------
00058       //------------------------------------------------------------------------
00059       XRootDStatus Open( const std::string &url,
00060                          OpenFlags::Flags   flags,
00061                          Access::Mode       mode,
00062                          ResponseHandler   *handler,
00063                          uint16_t           timeout  = 0 );
00064 
00065       //------------------------------------------------------------------------
00074       //------------------------------------------------------------------------
00075       XRootDStatus Open( const std::string &url,
00076                          OpenFlags::Flags   flags,
00077                          Access::Mode       mode    = Access::None,
00078                          uint16_t           timeout = 0 );
00079 
00080       //------------------------------------------------------------------------
00087       //------------------------------------------------------------------------
00088       XRootDStatus Close( ResponseHandler *handler,
00089                           uint16_t         timeout = 0 );
00090 
00091       //------------------------------------------------------------------------
00097       //------------------------------------------------------------------------
00098       XRootDStatus Close( uint16_t timeout = 0 );
00099 
00100       //------------------------------------------------------------------------
00110       //------------------------------------------------------------------------
00111       XRootDStatus Stat( bool             force,
00112                          ResponseHandler *handler,
00113                          uint16_t         timeout = 0 );
00114 
00115       //------------------------------------------------------------------------
00123       //------------------------------------------------------------------------
00124       XRootDStatus Stat( bool       force,
00125                          StatInfo *&response,
00126                          uint16_t   timeout = 0 );
00127 
00128 
00129       //------------------------------------------------------------------------
00142       //------------------------------------------------------------------------
00143       XRootDStatus Read( uint64_t         offset,
00144                          uint32_t         size,
00145                          void            *buffer,
00146                          ResponseHandler *handler,
00147                          uint16_t         timeout = 0 );
00148 
00149       //------------------------------------------------------------------------
00159       //------------------------------------------------------------------------
00160       XRootDStatus Read( uint64_t  offset,
00161                          uint32_t  size,
00162                          void     *buffer,
00163                          uint32_t &bytesRead,
00164                          uint16_t  timeout = 0 );
00165 
00166       //------------------------------------------------------------------------
00179       //------------------------------------------------------------------------
00180       XRootDStatus Write( uint64_t         offset,
00181                           uint32_t         size,
00182                           const void      *buffer,
00183                           ResponseHandler *handler,
00184                           uint16_t         timeout = 0 );
00185 
00186       //------------------------------------------------------------------------
00199       //------------------------------------------------------------------------
00200       XRootDStatus Write( uint64_t    offset,
00201                           uint32_t    size,
00202                           const void *buffer,
00203                           uint16_t    timeout = 0 );
00204 
00205       //------------------------------------------------------------------------
00212       //------------------------------------------------------------------------
00213       XRootDStatus Sync( ResponseHandler *handler,
00214                          uint16_t         timeout = 0 );
00215 
00216 
00217       //------------------------------------------------------------------------
00223       //------------------------------------------------------------------------
00224       XRootDStatus Sync( uint16_t timeout = 0 );
00225 
00226       //------------------------------------------------------------------------
00234       //------------------------------------------------------------------------
00235       XRootDStatus Truncate( uint64_t         size,
00236                              ResponseHandler *handler,
00237                              uint16_t         timeout = 0 );
00238 
00239 
00240       //------------------------------------------------------------------------
00247       //------------------------------------------------------------------------
00248       XRootDStatus Truncate( uint64_t size, uint16_t timeout = 0 );
00249 
00250       //------------------------------------------------------------------------
00266       //------------------------------------------------------------------------
00267       XRootDStatus VectorRead( const ChunkList &chunks,
00268                                void            *buffer,
00269                                ResponseHandler *handler,
00270                                uint16_t         timeout = 0 );
00271 
00272       //------------------------------------------------------------------------
00288       //------------------------------------------------------------------------
00289       XRootDStatus VectorRead( const ChunkList  &chunks,
00290                                void             *buffer,
00291                                VectorReadInfo  *&vReadInfo,
00292                                uint16_t          timeout = 0 );
00293 
00294       //------------------------------------------------------------------------
00296       //------------------------------------------------------------------------
00297       bool IsOpen() const;
00298 
00299       //------------------------------------------------------------------------
00302       //------------------------------------------------------------------------
00303       void EnableReadRecovery( bool enable = true );
00304 
00305       //------------------------------------------------------------------------
00308       //------------------------------------------------------------------------
00309       void EnableWriteRecovery( bool enable = true );
00310 
00311       //------------------------------------------------------------------------
00313       //------------------------------------------------------------------------
00314       std::string GetDataServer() const;
00315 
00316       //------------------------------------------------------------------------
00318       //------------------------------------------------------------------------
00319       URL GetLastURL() const;
00320 
00321     private:
00322       FileStateHandler *pStateHandler;
00323   };
00324 }
00325 
00326 #endif // __XRD_CL_FILE_HH__

Generated on 16 Jan 2014 for xrootd by  doxygen 1.4.7