AppCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
EBinarySortedFileSearch Class Reference

(Internal) Class implements binary search on file More...

#include <EBinarySortedFileSearch.h>

Public Member Functions

 EBinarySortedFileSearch ()
 
 EBinarySortedFileSearch (const EBinarySortedFileSearch &rhs)
 
 ~EBinarySortedFileSearch ()
 
bool Init (std::string path, EBinaryRecord *prototype, unsigned short headSize=0)
 
EBinaryRecordCol Find (std::string key)
 
 EBinarySortedFileSearch ()
 
 EBinarySortedFileSearch (const EBinarySortedFileSearch &rhs)
 
 ~EBinarySortedFileSearch ()
 
bool Init (std::string path, EBinaryRecord *prototype, unsigned short headSize=0)
 
EBinaryRecordCol Find (std::string key)
 

Detailed Description

(Internal) Class implements binary search on file

File consists of records, which structure is defined by creating class inherited from EBinaryRecord interface. File must be sorted by search key.

Constructor & Destructor Documentation

EBinarySortedFileSearch::EBinarySortedFileSearch ( )
EBinarySortedFileSearch::EBinarySortedFileSearch ( const EBinarySortedFileSearch rhs)
EBinarySortedFileSearch::~EBinarySortedFileSearch ( )
EBinarySortedFileSearch::EBinarySortedFileSearch ( )
EBinarySortedFileSearch::EBinarySortedFileSearch ( const EBinarySortedFileSearch rhs)
EBinarySortedFileSearch::~EBinarySortedFileSearch ( )

Member Function Documentation

EBinaryRecordCol EBinarySortedFileSearch::Find ( std::string  key)

Searching by key

Parameters
key= search key (key "--all" returns all records from file)
Returns
Collection of all records with key "key". These record ARE NOT deleted by EBinarySortedFileSearch!

Here is the call graph for this function:

EBinaryRecordCol EBinarySortedFileSearch::Find ( std::string  key)

Searching by key

Parameters
key= search key (key "--all" returns all records from file)
Returns
Collection of all records with key "key". These record ARE NOT deleted by EBinarySortedFileSearch!
bool EBinarySortedFileSearch::Init ( std::string  path,
EBinaryRecord prototype,
unsigned short  headSize = 0 
)

Inicialization of search engine

Parameters
path= absolute path of file including its name ( e.g. "/tmp/records.bin" )
prototype= instance of class inherited from EBinaryRecord which defines the structure of data in file (deleted by EBinarySortedFileSearch)
headSize= size of file header in bytes (0 = file doesn't have any header)
Returns
false = file not found true = otherwise
bool EBinarySortedFileSearch::Init ( std::string  path,
EBinaryRecord prototype,
unsigned short  headSize = 0 
)

Inicialization of search engine

Parameters
path= absolute path of file including its name ( e.g. "/tmp/records.bin" )
prototype= instance of class inherited from EBinaryRecord which defines the structure of data in file (deleted by EBinarySortedFileSearch)
headSize= size of file header in bytes (0 = file doesn't have any header)
Returns
false = file not found true = otherwise

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