cmn_SkipTbl4FS Class Reference
[G_new_group]

#include <cmn_FastSearch.h>

List of all members.


Detailed Description

This class hold skip table an pattern for fast search class.

Author:
Dejan Volk Lupo, HERMES SoftLab
See also:
cmn_FastSearch

Definition at line 90 of file cmn_FastSearch.h.


Public Member Functions

 cmn_SkipTbl4FS (const string &a_pattern)
 ~cmn_SkipTbl4FS ()
void SetPattern (const string &a_pattern)
void CreateSkipTbl ()
 initialization of skip table
const UInt16_tGettSkipTbl () const
const char * GetPattern () const
UInt32_t GetPatternLen () const

Public Attributes

 log_CLASSID_m

Private Attributes

string m_pattern
 string to search
UInt16_t m_skipTbl [ASIZE_d]
 Skip table.

Constructor & Destructor Documentation

cmn_SkipTbl4FS::cmn_SkipTbl4FS ( const string &  a_pattern  ) 

Definition at line 37 of file cmn_SkipTbl4FS.cpp.

References CreateSkipTbl(), and log_FUNC_m.

00039         :
00040         m_pattern(a_pattern)
00041 {
00042     log_FUNC_m(cmn_SkipTbl4FS);
00043 
00044     CreateSkipTbl();
00045 }
//============================================================================//

Here is the call graph for this function:

cmn_SkipTbl4FS::~cmn_SkipTbl4FS (  )  [inline]

Definition at line 94 of file cmn_FastSearch.h.

00094 {};


Member Function Documentation

void cmn_SkipTbl4FS::SetPattern ( const string &  a_pattern  ) 

Definition at line 68 of file cmn_SkipTbl4FS.cpp.

References CreateSkipTbl(), log_FUNC_m, and m_pattern.

00068                                                        {
00069     log_FUNC_m(SetPattern);
00070 
00071     m_pattern = a_pattern;
00072     CreateSkipTbl();
00073 }

Here is the call graph for this function:

void cmn_SkipTbl4FS::CreateSkipTbl (  ) 

initialization of skip table

Definition at line 49 of file cmn_SkipTbl4FS.cpp.

References ASIZE_d, log_FUNC_m, m_pattern, and m_skipTbl.

Referenced by cmn_SkipTbl4FS(), and SetPattern().

00049                                    {
00050     log_FUNC_m(CreateSkipTbl);
00051 
00052     int pattLen = (UInt32_t)m_pattern.length();
00053     UInt16_t *p = m_skipTbl;
00054 
00055     for (int i = 0; i < ASIZE_d; i++) {
00056         *p = pattLen;
00057         p++;
00058     }
00059 
00060     const char *r = m_pattern.data();
00061     for (int k = 1; k < pattLen; k++, r++) {
00062         m_skipTbl[(UInt8_t)*r] = pattLen - k;
00063     }
00064 }

Here is the caller graph for this function:

const UInt16_t* cmn_SkipTbl4FS::GettSkipTbl (  )  const [inline]

Definition at line 112 of file cmn_FastSearch.h.

Referenced by cmn_FastPattSearch::Find().

00112 { return m_skipTbl; };

Here is the caller graph for this function:

const char* cmn_SkipTbl4FS::GetPattern (  )  const [inline]

Definition at line 113 of file cmn_FastSearch.h.

Referenced by cmn_FastPattSearch::Find().

00113 { return m_pattern.data(); };

Here is the caller graph for this function:

UInt32_t cmn_SkipTbl4FS::GetPatternLen (  )  const [inline]

Definition at line 114 of file cmn_FastSearch.h.

Referenced by cmn_FastPattSearch::Find().

00114 { return static_cast<UInt32_t>(m_pattern.length()); };

Here is the caller graph for this function:


Member Data Documentation

string cmn_SkipTbl4FS::m_pattern [private]

string to search

Definition at line 94 of file cmn_FastSearch.h.

Referenced by CreateSkipTbl(), and SetPattern().

UInt16_t cmn_SkipTbl4FS::m_skipTbl[ASIZE_d] [private]

Skip table.

Definition at line 101 of file cmn_FastSearch.h.

Referenced by CreateSkipTbl().

Definition at line 104 of file cmn_FastSearch.h.


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

Generated on Mon Feb 27 19:05:28 2012 for OPENARCHIVE by  doxygen 1.5.6