FlashGraph-ng
A new frontier in large-scale graph analysis and data mining
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Member Functions | List of all members
safs::page_byte_array Class Referenceabstract

#include <cache.h>

Inherited by safs::sub_page_byte_array.

Classes

class  const_iterator
 
class  seq_const_iterator
 

Public Member Functions

virtual void lock ()=0
 
virtual void unlock ()=0
 
virtual size_t get_size () const =0
 
virtual page_byte_arrayclone ()=0
 
virtual off_t get_offset () const =0
 
template<class T >
const_iterator< T > begin (off_t byte_off=0) const
 
template<class T >
const_iterator< T > end () const
 
template<class T >
std::pair< const_iterator< T >
, const_iterator< T > > 
get_iterator (off_t byte_off, off_t byte_end) const
 
template<class T >
seq_const_iterator< T > get_seq_iterator (off_t byte_off, off_t byte_end) const
 
void memcpy (off_t rel_off, char buf[], size_t size) const
 

Detailed Description

This byte array helps users access data in non-contiguous pages in the page cache. It provides a STL-style iterator and a Java-style iterator to access elements in the byte array.

Member Function Documentation

template<class T >
const_iterator<T> safs::page_byte_array::begin ( off_t  byte_off = 0) const
inline

This method gets the STL-compatible iterator that points to the user-specified location in the byte array.

Parameters
byte_offthe offset (in bytes) in the byte array.
Returns
the iterator to the specified location in the byte array.
virtual page_byte_array* safs::page_byte_array::clone ( )
pure virtual

This clones the byte array.

template<class T >
const_iterator<T> safs::page_byte_array::end ( ) const
inline

This method gets the STL-compatible iterator that points to the end of the byte array.

Returns
the iterator to the end of the byte array.
template<class T >
std::pair<const_iterator<T>, const_iterator<T> > safs::page_byte_array::get_iterator ( off_t  byte_off,
off_t  byte_end 
) const
inline

This method returns a pair of iterators that iterate over the range on the byte array, specified by the user.

Parameters
byte_offthe beginning offset (in bytes) in the byte array.
byte_endthe end offset (in bytes) in the byte array.
Returns
a pair of iterators. The first iterator points to the beginning offset and the second one points to the end offset.
virtual off_t safs::page_byte_array::get_offset ( ) const
pure virtual

This method gets the location of the byte array in the SAFS file.

Returns
the location of the byte array in the SAFS file.
template<class T >
seq_const_iterator<T> safs::page_byte_array::get_seq_iterator ( off_t  byte_off,
off_t  byte_end 
) const
inline

This method gets the Java-style iterator that iterates elements in the specified range in the byte array.

Parameters
byte_offthe beginning offset (in bytes) in the byte array.
byte_endthe end offset (in bytes) in the byte array.
Returns
the Java-style iterator.
virtual size_t safs::page_byte_array::get_size ( ) const
pure virtual

This method gets the size of the byte array.

Returns
the size of the byte array.
virtual void safs::page_byte_array::lock ( )
pure virtual

This method locks the byte array. It's currently not implemented yet.

void safs::page_byte_array::memcpy ( off_t  rel_off,
char  buf[],
size_t  size 
) const

This method copies data to a buffer.

Parameters
rel_offthe offset relative to the beginning of the array.
bufthe buffer
sizethe size of data copied to the buffer.
virtual void safs::page_byte_array::unlock ( )
pure virtual

This method unlocks the byte array. It's currently not implemented yet.


The documentation for this class was generated from the following file: