00001 #ifndef __XRDCLIABSMONINTF_H__ 00002 #define __XRDCLIABSMONINTF_H__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d C l i e n t A b s M o n I n t f . h h */ 00006 /* */ 00007 /* This file is part of the XRootD software suite. */ 00008 /* */ 00009 /* XRootD is free software: you can redistribute it and/or modify it under */ 00010 /* the terms of the GNU Lesser General Public License as published by the */ 00011 /* Free Software Foundation, either version 3 of the License, or (at your */ 00012 /* option) any later version. */ 00013 /* */ 00014 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00015 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00016 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00017 /* License for more details. */ 00018 /* */ 00019 /* You should have received a copy of the GNU Lesser General Public License */ 00020 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00021 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00022 /* */ 00023 /* The copyright holder's institutional names and contributor's names may not */ 00024 /* be used to endorse or promote products derived from this software without */ 00025 /* specific prior written permission of the institution or contributor. */ 00026 /******************************************************************************/ 00027 00028 // XrdClientAbsMonIntf 00029 // Public interface to generic monitoring systems 00030 // 00031 00032 class XrdClientAbsMonIntf { 00033 public: 00034 00035 00036 // Initialization of the external library 00037 virtual int Init(const char *src, const char *dest, int debug=0, void *parm=0) = 0; 00038 virtual int DeInit() = 0; 00039 00040 // To get the name of the library and other info 00041 virtual int GetMonLibInfo(char **name, char **version, char **remarks) = 0; 00042 00043 00044 // To submit a set of info about the progress of something 00045 // Set force to true to be sure that the info is sent and not eventually skipped 00046 virtual int PutProgressInfo(long long bytecount=0, 00047 long long size=0, 00048 float percentage=0.0, 00049 bool force=false) = 0; 00050 00051 00052 XrdClientAbsMonIntf() {}; 00053 virtual ~XrdClientAbsMonIntf() {}; 00054 }; 00055 00056 00057 00058 00059 /******************************************************************************/ 00060 /* X r d C l i e n t A b s M o n I n t f . h h */ 00061 /******************************************************************************/ 00062 00063 // The XrdClientMonIntf() function is called when the shared library containing 00064 // implementation of this class is loaded. It must exist in the library as an 00065 // 'extern "C"' defined function. 00066 00067 00068 #define XrdClientMonIntfArgs const char *src, const char *dst 00069 00070 extern "C" { 00071 typedef XrdClientAbsMonIntf *(*XrdClientMonIntfHook)(XrdClientMonIntfArgs); 00072 XrdClientAbsMonIntf *XrdClientgetMonIntf(XrdClientMonIntfArgs); 00073 } 00074 #endif