21 #ifndef DDCLessOperators_h 22 #define DDCLessOperators_h 30 template <
class IndexType,
typename VectorType=vector<
char> >
42 bool operator()(
const IndexType& Ref,
const char* S2)
const 44 const char* S1 = &((*m_pBuffer)[0]) + Ref.GetIndexItemOffset();
45 return strcmp(S1, S2) < 0;
47 bool operator()(
const char* S1,
const IndexType& Ref)
const 49 const char* S2 = &((*m_pBuffer)[0]) + Ref.GetIndexItemOffset();
50 return strcmp(S1, S2) < 0;
52 bool operator()(
const IndexType& Ref1,
const IndexType& Ref2)
const 54 const char* S1 = &((*m_pBuffer)[0]) + Ref1.GetIndexItemOffset();
55 const char* S2 = &((*m_pBuffer)[0]) + Ref2.GetIndexItemOffset();
56 return strcmp(S1, S2) < 0;
60 bool are_equal(
const IndexType& Ref,
const char* S2)
const 62 const char* S1 = &((*m_pBuffer)[0]) + Ref.GetIndexItemOffset();
63 return strcmp(S1, S2) == 0;
74 template <
class IndexType,
typename VectorType=vector<
char> >
75 class LessIndexString2 :
public binary_function<bool, const IndexType&, const IndexType&>
83 m_pBuffer1 = pBuffer1;
84 m_pBuffer2 = (pBuffer2 != 0) ? pBuffer2 : pBuffer1;
88 bool operator()(
const IndexType& W1,
const IndexType& W2)
const 90 const char* S1 = &((*m_pBuffer1)[0]) + W1.GetIndexItemOffset();
91 const char* S2 = &((*m_pBuffer2)[0]) + W2.GetIndexItemOffset();
92 return strcmp(S1, S2) < 0;
96 bool Greater(
const IndexType& W1,
const IndexType& W2)
const 98 const char* S1 = &((*m_pBuffer1)[0]) + W1.GetIndexItemOffset();
99 const char* S2 = &((*m_pBuffer2)[0]) + W2.GetIndexItemOffset();
100 return strcmp(S1, S2) > 0;
const VectorType * m_pBuffer2
Definition: DDCLessOperators.h:78
const VectorType * m_pBuffer
Definition: DDCLessOperators.h:33
LessIndexString1(const VectorType *pBuffer)
Definition: DDCLessOperators.h:37
bool operator()(const IndexType &Ref, const char *S2) const
operator less for strings
Definition: DDCLessOperators.h:42
Definition: DDCLessOperators.h:31
const VectorType * m_pBuffer1
Definition: DDCLessOperators.h:77
bool Greater(const IndexType &W1, const IndexType &W2) const
operator greater for strings
Definition: DDCLessOperators.h:96
Definition: DDCLessOperators.h:75
bool operator()(const char *S1, const IndexType &Ref) const
Definition: DDCLessOperators.h:47
bool operator()(const IndexType &W1, const IndexType &W2) const
operator less for strings
Definition: DDCLessOperators.h:88
bool are_equal(const IndexType &Ref, const char *S2) const
operator == for strings
Definition: DDCLessOperators.h:60
LessIndexString2(const VectorType *pBuffer1, const VectorType *pBuffer2=0)
Definition: DDCLessOperators.h:81
bool operator()(const IndexType &Ref1, const IndexType &Ref2) const
Definition: DDCLessOperators.h:52