Back to index

nordugrid-arc-nox  1.1.0~rc6
DataPointFile.h
Go to the documentation of this file.
00001 // -*- indent-tabs-mode: nil -*-
00002 
00003 #ifndef __ARC_DATAPOINTFILE_H__
00004 #define __ARC_DATAPOINTFILE_H__
00005 
00006 #include <list>
00007 
00008 #include <arc/Thread.h>
00009 #include <arc/data/DataPointDirect.h>
00010 
00011 namespace Arc {
00012 
00013   class DataPointFile
00014     : public DataPointDirect {
00015   public:
00016     DataPointFile(const URL& url, const UserConfig& usercfg);
00017     virtual ~DataPointFile();
00018     static Plugin* Instance(PluginArgument *arg);
00019     virtual DataStatus StartReading(DataBuffer& buffer);
00020     virtual DataStatus StartWriting(DataBuffer& buffer,
00021                                     DataCallback *space_cb = NULL);
00022     virtual DataStatus StopReading();
00023     virtual DataStatus StopWriting();
00024     virtual DataStatus Check();
00025     virtual DataStatus Remove();
00026     virtual DataStatus ListFiles(std::list<FileInfo>& files,
00027                                  bool long_list = false, bool resolve = false,
00028                                  bool metadata = false);
00029     virtual bool WriteOutOfOrder();
00030   private:
00031     SimpleCondition transfer_cond;
00032     static void read_file_start(void* arg);
00033     static void write_file_start(void* arg);
00034     void read_file();
00035     void write_file();
00036     bool reading;
00037     bool writing;
00038     int fd;
00039     bool is_channel;
00040     static Logger logger;
00041   };
00042 
00043 } // namespace Arc
00044 
00045 #endif // __ARC_DATAPOINTFILE_H__