25 #ifndef FILEINFOCACHE_H
26 #define FILEINFOCACHE_H
48 void putStat(
const char *pcPath,
const deque<string>& statOutput);
49 void putReadLink(
const char *pcPath,
const deque<string>& readLinkOutput);
52 const deque<string>* getStat(
const char *pcPath)
const ;
53 const deque<string>* getReadLink(
const char *pcPath)
const;
56 void invalidate(
const char *pcPath);
66 Entry() : m_Timestamp(::time(NULL)), m_pStatOutput(NULL), m_pReadLinkOutput(NULL) {}
76 void timeStamp(
const time_t& time) { m_Timestamp = time; }
77 void statOutput(
const deque<string>& output);
78 void readLinkOutput(
const deque<string>& output);
81 const time_t
timeStamp()
const {
return(m_Timestamp); }
82 const deque<string> *
statOutput()
const {
return(m_pStatOutput); }
97 bool isValid(
const Entry& entry)
const;
115 void pendingOpen(
const char *pcPath,
const bool fPendingOpen,
const bool fForWrite);
116 void pendingOpen(
const char *pcPath,
const string& strRenamedFromLocal);
117 void truncated(
const char *pcPath,
const bool fTruncated);
120 bool pendingOpen(
const char *pcPath)
const;
121 bool truncated(
const char *pcPath)
const;
124 int flush(
const char *pcPath,
const string& strFromLocalPath);
125 int release(
const char *pcPath,
const int iFh);
135 Entry() : m_fPendingOpen(false), m_fForWrite(false), m_fTruncated(false), m_strRenamedFromLocal() {}
141 void pendingOpen(
const bool fPendingOpen,
const bool fForWrite) { m_fPendingOpen = fPendingOpen; m_fForWrite = fForWrite; }
142 void pendingOpen(
const string& strRenamedFromLocal) { m_fPendingOpen =
true; m_strRenamedFromLocal.assign(strRenamedFromLocal); }
143 void truncated(
const bool fTruncated) { m_fTruncated = fTruncated; }
150 int release(
const int iFh);
151 int flush(
const string& strFromLocalPath,
const string& strToPat);
FileStatus()
Default constructor.
deque< string > * m_pStatOutput
Keep track of files opened and truncated files.
deque< string > * m_pReadLinkOutput
const bool pendingOpen() const
Entry()
Default constructor.
const deque< string > * statOutput() const
A cache for file attributes and resolved links.
const time_t timeStamp() const
void truncated(const bool fTruncated)
FileCache()
Default constructor.
Entry()
Default constructor.
virtual ~FileCache()
Virtual destructor.
virtual ~Entry()
Virtual destructor.
void timeStamp(const time_t &time)
Set the entries time stamp.
void pendingOpen(const string &strRenamedFromLocal)
Represents an entry of FileStatus.
const bool truncated() const
Represents an entry of FileCache.
map< string, Entry > m_Entries
string m_strRenamedFromLocal
const deque< string > * readLinkOutput() const
void pendingOpen(const bool fPendingOpen, const bool fForWrite)
virtual ~FileStatus()
Virtual destructor.
map< string, Entry > m_Entries