A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/classCStaticArraySearchBase.html below:

NCBI C++ ToolKit: CStaticArraySearchBase< KeyValueGetter, KeyCompare

Search Toolkit Book for CStaticArraySearchBase

class CStaticArraySet<> is an array adaptor that provides an STLish interface to statically-defined arrays, while making efficient use of the inherent sort order of such arrays. More...

#include <util/static_set.hpp>

template<size_t Size>   CStaticArraySearchBase (const value_type(&arr)[Size], const char *file, int line, NStaticArray::ECopyWarn warn)   Default constructor. More...
  template<size_t Size>   CStaticArraySearchBase (const value_type(&arr)[Size], const key_compare &comp, const char *file, int line, NStaticArray::ECopyWarn warn)   Constructor to initialize comparator object. More...
  template<typename Type >   CStaticArraySearchBase (const Type *array_ptr, size_type array_size, const char *file, int line, NStaticArray::ECopyWarn warn)   Default constructor. More...
  template<typename Type >   CStaticArraySearchBase (const Type *array_ptr, size_type array_size, const key_compare &comp, const char *file, int line, NStaticArray::ECopyWarn warn)   Constructor to initialize comparator object. More...
    ~CStaticArraySearchBase (void)   Destructor. More...
  const value_comparevalue_comp () const   const key_comparekey_comp () const   const_iterator  begin () const   Return the start of the controlled sequence. More...
  const_iterator  end () const   Return the end of the controlled sequence. More...
  bool  empty () const   Return true if the container is empty. More...
  size_type  size () const   Return number of elements in the container. More...
  const_iterator  lower_bound (const key_type &key) const   Return an iterator into the sequence such that the iterator's key is less than or equal to the indicated key. More...
  const_iterator  upper_bound (const key_type &key) const   Return an iterator into the sequence such that the iterator's key is greater than the indicated key. More...
  const_iterator  find (const key_type &key) const   Return a const_iterator pointing to the specified element, or to the end if the element is not found. More...
  size_type  count (const key_type &key) const   Return the count of the elements in the sequence. More...
  pair< const_iterator, const_iteratorequal_range (const key_type &key) const   Return a pair of iterators bracketing the given element in the controlled sequence. More...
  difference_type  index_of (const key_type &key) const   Return the index of the indicated element, or eNpos if the element is not found. More...
  template<typename KeyValueGetter, typename KeyCompare>
class CStaticArraySearchBase< KeyValueGetter, KeyCompare >

class CStaticArraySet<> is an array adaptor that provides an STLish interface to statically-defined arrays, while making efficient use of the inherent sort order of such arrays.

This class can be used both to verify sorted order of a static array and to access a static array cleanly. The template parameters are as follows:

KeyType – type of object used for access KeyCompare – comparison functor. This must provide an operator(). This is patterned to accept PCase and PNocase and similar objects.

To use this class, define your static array as follows:

static const char* sc_MyArray[] = { "val1", "val2", "val3" };

Then, declare a static variable such as:

typedef StaticArraySet<const char*, PNocase_CStr> TStaticArray; static TStaticArray sc_Array(sc_MyArray, sizeof(sc_MyArray));

In debug mode, the constructor will scan the list of items and insure that they are in the sort order defined by the comparator used. If the sort order is not correct, then the constructor will ASSERT().

This can then be accessed as

if (sc_Array.find(some_value) != sc_Array.end()) { ... }

or

size_t idx = sc_Array.index_of(some_value); if (idx != TStaticArray::eNpos) { ... }

Definition at line 560 of file static_set.hpp.

◆ const_iterator

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 574 of file static_set.hpp.

◆ const_reference

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 573 of file static_set.hpp.

◆ difference_type

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 576 of file static_set.hpp.

◆ getter

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 567 of file static_set.hpp.

◆ key_compare

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 571 of file static_set.hpp.

◆ key_type

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 569 of file static_set.hpp.

◆ mapped_type

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 570 of file static_set.hpp.

◆ size_type

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 575 of file static_set.hpp.

◆ TDeallocateFunc

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 806 of file static_set.hpp.

◆ value_compare

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 572 of file static_set.hpp.

◆ value_type

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 568 of file static_set.hpp.

◆ anonymous enum

template<typename KeyValueGetter , typename KeyCompare >

◆ CStaticArraySearchBase() [1/4]

template<typename KeyValueGetter , typename KeyCompare >

template<size_t Size>

Default constructor.

This will build a set around a given array; the storage of the end pointer is based on the supplied array size. In debug mode, this will verify that the array is sorted.

Definition at line 582 of file static_set.hpp.

◆ CStaticArraySearchBase() [2/4]

template<typename KeyValueGetter , typename KeyCompare >

template<size_t Size>

Constructor to initialize comparator object.

Definition at line 591 of file static_set.hpp.

◆ CStaticArraySearchBase() [3/4]

template<typename KeyValueGetter , typename KeyCompare >

template<typename Type >

Default constructor.

This will build a set around a given array; the storage of the end pointer is based on the supplied array size. In debug mode, this will verify that the array is sorted.

Definition at line 604 of file static_set.hpp.

◆ CStaticArraySearchBase() [4/4]

template<typename KeyValueGetter , typename KeyCompare >

template<typename Type >

Constructor to initialize comparator object.

Definition at line 613 of file static_set.hpp.

◆ ~CStaticArraySearchBase()

template<typename KeyValueGetter , typename KeyCompare >

◆ begin()

template<typename KeyValueGetter , typename KeyCompare >

Return the start of the controlled sequence.

Definition at line 641 of file static_set.hpp.

Referenced by CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::empty(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::index_of(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::lower_bound(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::size(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::upper_bound(), and CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_DeallocateFunc().

◆ count()

template<typename KeyValueGetter , typename KeyCompare >

Return the count of the elements in the sequence.

This will be either 0 or 1, as this structure holds unique keys.

Definition at line 688 of file static_set.hpp.

◆ empty()

template<typename KeyValueGetter , typename KeyCompare >

Return true if the container is empty.

Definition at line 653 of file static_set.hpp.

◆ end()

template<typename KeyValueGetter , typename KeyCompare >

Return the end of the controlled sequence.

Definition at line 647 of file static_set.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::empty(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::find(), CGb_qual::FixPseudogeneValue(), CGb_qual::FixRptTypeValue(), CClientPseudoTypeStrings::GenerateClassCode(), CSeqFeatData::IsRegulatory(), CBioSource::IsStopWord(), CCountries::IsValid(), CGb_qual::IsValidPseudogeneValue(), CGb_qual::IsValidRptTypeValue(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::lower_bound(), CSeq_gap::NameToGapTypeInfo(), CTableNames::NameToTable(), s_IsTaxNameElement(), s_MayIgnoreCase(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::size(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::upper_bound(), CImpFeatValidator::Validate(), CCountries::WasValid(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_Bad(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_DeallocateFunc(), and CCountries::x_FindCountryName().

◆ equal_range()

template<typename KeyValueGetter , typename KeyCompare >

Return a pair of iterators bracketing the given element in the controlled sequence.

Definition at line 696 of file static_set.hpp.

◆ find()

template<typename KeyValueGetter , typename KeyCompare >

Return a const_iterator pointing to the specified element, or to the end if the element is not found.

Definition at line 680 of file static_set.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CGb_qual::FixPseudogeneValue(), CGb_qual::FixRptTypeValue(), CClientPseudoTypeStrings::GenerateClassCode(), CSeqFeatData::IsRegulatory(), CBioSource::IsStopWord(), CCountries::IsValid(), CGb_qual::IsValidPseudogeneValue(), CGb_qual::IsValidRptTypeValue(), CSeq_gap::NameToGapTypeInfo(), CTableNames::NameToTable(), s_IsTaxNameElement(), s_MayIgnoreCase(), CImpFeatValidator::Validate(), CCountries::WasValid(), and CCountries::x_FindCountryName().

◆ index_of()

template<typename KeyValueGetter , typename KeyCompare >

Return the index of the indicated element, or eNpos if the element is not found.

Definition at line 708 of file static_set.hpp.

◆ key_comp()

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 635 of file static_set.hpp.

◆ lower_bound()

template<typename KeyValueGetter , typename KeyCompare >

Return an iterator into the sequence such that the iterator's key is less than or equal to the indicated key.

Definition at line 666 of file static_set.hpp.

Referenced by CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::count(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::equal_range(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::find(), and CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::index_of().

◆ size()

template<typename KeyValueGetter , typename KeyCompare >

◆ upper_bound()

template<typename KeyValueGetter , typename KeyCompare >

Return an iterator into the sequence such that the iterator's key is greater than the indicated key.

Definition at line 673 of file static_set.hpp.

◆ value_comp()

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 630 of file static_set.hpp.

Referenced by CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::key_comp(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::lower_bound(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::upper_bound(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_Bad(), and CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_Set().

◆ x_Bad()

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 814 of file static_set.hpp.

Referenced by CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::count(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::equal_range(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::find(), and CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::index_of().

◆ x_DeallocateFunc()

template<typename KeyValueGetter , typename KeyCompare >

◆ x_Set() [1/2]

template<typename KeyValueGetter , typename KeyCompare >

template<typename Type >

Assign array pointer and end pointer from differently typed array.

Allocate necessarily typed array and copy its content.

Definition at line 758 of file static_set.hpp.

◆ x_Set() [2/2]

template<typename KeyValueGetter , typename KeyCompare >

◆ x_Validate()

template<typename KeyValueGetter , typename KeyCompare >

◆ m_Begin

template<typename KeyValueGetter , typename KeyCompare >

Definition at line 810 of file static_set.hpp.

Referenced by CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::begin(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::value_comp(), CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_Set(), and CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::~CStaticArraySearchBase().

◆ m_DeallocateFunc

template<typename KeyValueGetter , typename KeyCompare >

◆ m_End

template<typename KeyValueGetter , typename KeyCompare >

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4