Function validate

Synopsis

#include <include/EASTL/bitvector.h>

int validate(const element_type *pStart, const element_type *pEnd, eastl_size_t nExtraBits) const

Description

No description yet.

Source

Lines 594-625 in include/EASTL/bitvector.h. Line 138 in include/EASTL/bitvector.h.

template <typename Element>
int bitvector_const_iterator<Element>::validate(const Element* pStart, const Element* pEnd, eastl_size_t nExtraBits) const
{
    const Element* const pCurrent = mReference.mpBitWord;
    if(pCurrent >= pStart)
    {
        if(nExtraBits == 0)
        {
            if(pCurrent == pEnd && mReference)
                return eastl::isf_valid | eastl::isf_current;
            else if(pCurrent < pEnd)
                return eastl::isf_valid | eastl::isf_current | eastl::isf_can_dereference;
        }
        else if(pCurrent == (pEnd - 1))
        {
            const size_type bit     = mReference.mnBitIndex;
            const size_type lastbit = kBitCount - nExtraBits;

            if(bit == lastbit)
                return eastl::isf_valid | eastl::isf_current;
            else if(bit < lastbit)
                return eastl::isf_valid | eastl::isf_current | eastl::isf_can_dereference;
        }
        else if(pCurrent < pEnd)
        {
            return eastl::isf_valid | eastl::isf_current | eastl::isf_can_dereference;
        }
    }
    return eastl::isf_none;
}





Add Discussion as Guest

Log in