limal::path::PathInfo::DevInoCache Class Reference

Simple cache remembering device/inode to detect hard links. More...

#include <PathInfo.hpp>

List of all members.

Public Member Functions

 DevInoCache ()
 Constructor.
void clear ()
 Clear cache.
bool insert (const dev_t &dev_r, const ino_t &ino_r)
 Remember dev/ino.

Private Attributes

BLOCXX_NAMESPACE::Map< dev_t,
std::set< ino_t > > 
_devino

Detailed Description

Simple cache remembering device/inode to detect hard links.

     PathInfo::DevInoCache trace;
     for ( all files ) {
       if ( trace.insert( file.device, file.inode ) ) {
         // 1st occurrence of file
       }
       else{
         // else: hard link; already counted this device/inode
       }
     }

Constructor & Destructor Documentation

limal::path::PathInfo::DevInoCache::DevInoCache (  )  [inline]

Constructor.


Member Function Documentation

void limal::path::PathInfo::DevInoCache::clear (  )  [inline]

Clear cache.

bool limal::path::PathInfo::DevInoCache::insert ( const dev_t &  dev_r,
const ino_t &  ino_r 
) [inline]

Remember dev/ino.

Returns:
  • true if it's inserted the first time
  • false if already present in cache (a hard link to a previously remembered file.

Member Data Documentation

BLOCXX_NAMESPACE ::Map<dev_t,std::set<ino_t> > limal::path::PathInfo::DevInoCache::_devino [private]

The documentation for this class was generated from the following file:
Generated on Mon Jul 5 22:00:06 2010 for limal by  doxygen 1.6.3