Public Member Functions | Public Attributes | Private Attributes

cmn_SkipTbl4FS Class Reference
[G_new_group]

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

#include <cmn_FastSearch.h>

List of all members.

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.

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 104 of file cmn_FastSearch.h.


Constructor & Destructor Documentation

cmn_SkipTbl4FS::cmn_SkipTbl4FS ( const string &  a_pattern  ) 

Definition at line 51 of file cmn_SkipTbl4FS.cpp.

References CreateSkipTbl(), and log_FUNC_m.

Here is the call graph for this function:

cmn_SkipTbl4FS::~cmn_SkipTbl4FS (  )  [inline]

Definition at line 108 of file cmn_FastSearch.h.

{};


Member Function Documentation

void cmn_SkipTbl4FS::CreateSkipTbl (  ) 

initialization of skip table

Definition at line 63 of file cmn_SkipTbl4FS.cpp.

References log_FUNC_m, m_pattern, and m_skipTbl.

Referenced by cmn_SkipTbl4FS(), and SetPattern().

                                   {
    log_FUNC_m(CreateSkipTbl);

    int pattLen = (UInt32_t)m_pattern.length();
    UInt16_t *p = m_skipTbl;

    for (int i = 0; i < ASIZE_d; i++) {
        *p = pattLen;
        p++;
    }

    const char *r = m_pattern.data();
    for (int k = 1; k < pattLen; k++, r++) {
        m_skipTbl[(UInt8_t)*r] = pattLen - k;
    }
}

Here is the caller graph for this function:

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

Definition at line 127 of file cmn_FastSearch.h.

Referenced by cmn_FastPattSearch::Find().

{ return m_pattern.data(); };

Here is the caller graph for this function:

UInt32_t cmn_SkipTbl4FS::GetPatternLen (  )  const [inline]

Definition at line 128 of file cmn_FastSearch.h.

Referenced by cmn_FastPattSearch::Find().

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

Here is the caller graph for this function:

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

Definition at line 126 of file cmn_FastSearch.h.

Referenced by cmn_FastPattSearch::Find().

{ return m_skipTbl; };

Here is the caller graph for this function:

void cmn_SkipTbl4FS::SetPattern ( const string &  a_pattern  ) 

Definition at line 82 of file cmn_SkipTbl4FS.cpp.

References CreateSkipTbl(), log_FUNC_m, and m_pattern.

Here is the call graph for this function:


Member Data Documentation

Definition at line 118 of file cmn_FastSearch.h.

string cmn_SkipTbl4FS::m_pattern [private]

string to search

Definition at line 108 of file cmn_FastSearch.h.

Referenced by CreateSkipTbl(), and SetPattern().

UInt16_t cmn_SkipTbl4FS::m_skipTbl[ASIZE_d] [private]

Skip table.

Definition at line 115 of file cmn_FastSearch.h.

Referenced by CreateSkipTbl().


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