DSILikeMatcher< T > Class Template Reference

A concrete implementation of the ILikeMather interface class. Acts as the base class for the CRTP implementation of the LIKE predicate. More...

Inherits Simba::DSI::ILikeMatcher.

List of all members.

Public Member Functions

 DSILikeMatcher (const void *in_pattern, simba_uint32 in_patternLength, const IndexVector &in_metaCharVector, const simba_int32 in_codeUnitSize=2)
 Constructor, builds the LikeVector of LikeNodes to be used in LIKE comparisons.
 DSILikeMatcher ()
 Default Constructor.
virtual bool Match (const void *in_haystack, const simba_uint32 in_hayLength) const
 Compare the haystack string against a given LIKE pattern. Calls the derived class.
 ~DSILikeMatcher ()
 Destructor.

Protected Member Functions

bool MatchImpl (const void *in_haystack, const simba_uint32 in_length) const
 Compares the haystack against the stored LIKE Pattern.

Detailed Description

template<typename T>
class Simba::DSI::DSILikeMatcher< T >

A concrete implementation of the ILikeMather interface class. Acts as the base class for the CRTP implementation of the LIKE predicate.


Constructor & Destructor Documentation

DSILikeMatcher (  )  [inline]

Default Constructor.

DSILikeMatcher ( const void *  in_pattern,
simba_uint32  in_patternLength,
const IndexVector in_metaCharVector,
const simba_int32  in_codeUnitSize = 2 
) [inline]

Constructor, builds the LikeVector of LikeNodes to be used in LIKE comparisons.

The input vector, in_metaCharVector, needs to be cleaned, normalized, and reduced.

Cleaned - meaning that the vector contains only non-escaped metacharacters and cannot contain ESCAPE metacharacters unless they are 'lone'.

Normalized - meaning that all adjacent metacharacters in a sequence, i.e. __%_, are reordered such that all underscores precede all percents in the sequence. (i.e. ___%%%)

Reduced - meaning that all metacharacters are removed if the are redundant (i.e. adjacent percents, '%' -> '') and all adjacent underscores '_' are grouped into a single element representation.

Element - Each element within the vector needs to contain: the indexes associated with the metacharacter, the type, and and the underscore count if '_'. See: IndexVector typedef.

Parameters:
in_pattern A pointer to a byte array containing the cleaned (no escape chars) pattern. (NOT OWN)
in_patternLength The length of in_pattern in bytes. in creating the LikeVector and nodes.
in_metaCharVector A cleaned, normalized, and reduced vector (no ESCPAE or ignorable metacharacters) containing all LIKE metacharacters and their corresponding indexes within the pattern.
in_codeUnitSize The size of a code unit in bytes.
~DSILikeMatcher (  )  [inline]

Destructor.


Member Function Documentation

bool Match ( const void *  in_haystack,
const simba_uint32  in_hayLength 
) const [inline, virtual]

Compare the haystack string against a given LIKE pattern. Calls the derived class.

Parameters:
in_haystack The match byte array to be compared against the stored pattern.
in_haylenth The length of in_haystack in bytes.
Returns:
true if the string matches against the pattern, false otherwise.

Implements ILikeMatcher.

bool MatchImpl ( const void *  in_haystack,
const simba_uint32  in_length 
) const [inline, protected]

Compares the haystack against the stored LIKE Pattern.

Parameters:
in_haystack The match byte array to be compared against the stored pattern.
in_length The length of in_haystack in bytes.
Returns:
true if the string matches against the pattern, false otherwise.

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

Generated on Wed May 17 14:21:15 2017 for SimbaEngine 10.1.3.1011 by simba