Back to index

nordugrid-arc-nox  1.1.0~rc6
DataPointDirect.h
Go to the documentation of this file.
00001 // -*- indent-tabs-mode: nil -*-
00002 
00003 #ifndef __ARC_DATAPOINTDIRECT_H__
00004 #define __ARC_DATAPOINTDIRECT_H__
00005 
00006 #include <list>
00007 #include <string>
00008 
00009 #include <arc/data/DataPoint.h>
00010 
00011 #define MAX_PARALLEL_STREAMS 20
00012 #define MAX_BLOCK_SIZE (1024 * 1024)
00013 
00014 namespace Arc {
00015 
00016   class DataBuffer;
00017   class DataCallback;
00018 
00020 
00027   class DataPointDirect
00028     : public DataPoint {
00029   public:
00030     DataPointDirect(const URL& url, const UserConfig& usercfg);
00031     virtual ~DataPointDirect();
00032 
00033     virtual bool IsIndex() const;
00034 
00035     virtual long long int BufSize() const;
00036     virtual int BufNum() const;
00037 
00038     virtual bool Local() const;
00039     virtual bool ReadOnly() const;
00040 
00041     virtual void ReadOutOfOrder(bool v);
00042     virtual bool WriteOutOfOrder();
00043 
00044     virtual void SetAdditionalChecks(bool v);
00045     virtual bool GetAdditionalChecks() const;
00046 
00047     virtual void SetSecure(bool v);
00048     virtual bool GetSecure() const;
00049 
00050     virtual void Passive(bool v);
00051 
00052     virtual void Range(unsigned long long int start = 0,
00053                        unsigned long long int end = 0);
00054 
00055     // Not supported for direct data points:
00056     virtual DataStatus Resolve(bool source);
00057     virtual bool Registered() const;
00058     virtual DataStatus PreRegister(bool replication, bool force = false);
00059     virtual DataStatus PostRegister(bool replication);
00060     virtual DataStatus PreUnregister(bool replication);
00061     virtual DataStatus Unregister(bool all);
00062     virtual bool AcceptsMeta();
00063     virtual bool ProvidesMeta();
00064     virtual const URL& CurrentLocation() const;
00065     virtual const std::string& CurrentLocationMetadata() const;
00066     virtual DataStatus CompareLocationMetadata() const;
00067     virtual bool NextLocation();
00068     virtual bool LocationValid() const;
00069     virtual bool HaveLocations() const;
00070     virtual DataStatus AddLocation(const URL& url, const std::string& meta);
00071     virtual DataStatus RemoveLocation();
00072     virtual DataStatus RemoveLocations(const DataPoint& p);
00073 
00074   protected:
00075     DataBuffer *buffer;
00076     long long int bufsize;
00077     int bufnum;
00078     bool local;
00079     bool readonly;
00080     bool linkable;
00081     bool is_secure;
00082     bool force_secure;
00083     bool force_passive;
00084     bool additional_checks;
00085     bool allow_out_of_order;
00086     unsigned long long int range_start;
00087     unsigned long long int range_end;
00088   };
00089 
00090 } // namespace Arc
00091 
00092 #endif // __ARC_DATAPOINTDIRECT_H__