NCBI C++ ToolKit
Public Types | Public Member Functions | Private Types | List of all members
CStaticArraySet< KeyType, KeyCompare > Class Template Reference

Search Toolkit Book for CStaticArraySet

#include <util/static_set.hpp>

+ Inheritance diagram for CStaticArraySet< KeyType, KeyCompare >:
+ Collaboration diagram for CStaticArraySet< KeyType, KeyCompare >:

Public Types

typedef TBase::value_type value_type
 
typedef TBase::const_iterator const_iterator
 
typedef TBase::size_type size_type
 
typedef TBase::key_compare key_compare
 
- Public Types inherited from CStaticArraySearchBase< NStaticArray::PKeyValueSelf< KeyType >, less< KeyType > >
enum  
 
typedef NStaticArray::PKeyValueSelf< KeyType > getter
 
typedef getter::value_type value_type
 
typedef getter::key_type key_type
 
typedef getter::mapped_type mapped_type
 
typedef less< KeyType > key_compare
 
typedef NStaticArray::PLessByKey< getter, key_comparevalue_compare
 
typedef const value_typeconst_reference
 
typedef const value_typeconst_iterator
 
typedef size_t size_type
 
typedef ssize_t difference_type
 

Public Member Functions

template<size_t Size>
 CStaticArraySet (const value_type(&arr)[Size], const char *file, int line, NStaticArray::ECopyWarn warn=NStaticArray::eCopyWarn_default)
 default constructor. More...
 
template<size_t Size>
 CStaticArraySet (const value_type(&arr)[Size], const key_compare &comp, const char *file, int line, NStaticArray::ECopyWarn warn=NStaticArray::eCopyWarn_default)
 Constructor to initialize comparator object. More...
 
template<class Type >
 CStaticArraySet (const Type *array_ptr, size_t array_size, const char *file, int line, NStaticArray::ECopyWarn warn=NStaticArray::eCopyWarn_default)
 default constructor. More...
 
template<class Type >
 CStaticArraySet (const Type *array_ptr, size_t array_size, const key_compare &comp, const char *file, int line, NStaticArray::ECopyWarn warn=NStaticArray::eCopyWarn_default)
 Constructor to initialize comparator object. More...
 
 CStaticArraySet (const_iterator obj, size_type array_size)
 
 CStaticArraySet (const_iterator obj, size_type array_size, const key_compare &comp)
 
- Public Member Functions inherited from CStaticArraySearchBase< NStaticArray::PKeyValueSelf< KeyType >, less< KeyType > >
 CStaticArraySearchBase (const value_type(&arr)[Size], const char *file, int line, NStaticArray::ECopyWarn warn)
 Default constructor. More...
 
 CStaticArraySearchBase (const value_type(&arr)[Size], const key_compare &comp, const char *file, int line, NStaticArray::ECopyWarn warn)
 Constructor to initialize comparator object. More...
 
 CStaticArraySearchBase (const Type *array_ptr, size_type array_size, const char *file, int line, NStaticArray::ECopyWarn warn)
 Default constructor. More...
 
 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...
 

Private Types

typedef CStaticArraySearchBase< NStaticArray::PKeyValueSelf< KeyType >, KeyCompare > TBase
 

Additional Inherited Members

- Protected Types inherited from CStaticArraySearchBase< NStaticArray::PKeyValueSelf< KeyType >, less< KeyType > >
typedef void(* TDeallocateFunc) (const_iterator &begin, const_iterator &end)
 
- Protected Member Functions inherited from CStaticArraySearchBase< NStaticArray::PKeyValueSelf< KeyType >, less< KeyType > >
void x_Set (const value_type *array_ptr, size_t array_size, const char *file, int line, NStaticArray::ECopyWarn)
 Assign array pointer and end pointer without conversion. More...
 
void x_Set (const Type *array2_ptr, size_t array2_size, const char *file, int line, NStaticArray::ECopyWarn warn)
 Assign array pointer and end pointer from differently typed array. More...
 
- Static Protected Member Functions inherited from CStaticArraySearchBase< NStaticArray::PKeyValueSelf< KeyType >, less< KeyType > >
static void x_Validate (const value_type *array, size_t size, const value_compare &comp, const char *file, int line)
 Perform sort-order validation. This is a no-op in release mode. More...
 
static void x_DeallocateFunc (const_iterator &begin_ref, const_iterator &end_ref)
 Function used for array destruction and deallocation if it was created from a differently typed static array. More...
 

Detailed Description

template<class KeyType, class KeyCompare = less<KeyType>>
class CStaticArraySet< KeyType, KeyCompare >

Definition at line 822 of file static_set.hpp.

Member Typedef Documentation

◆ const_iterator

template<class KeyType , class KeyCompare = less<KeyType>>
typedef TBase::const_iterator CStaticArraySet< KeyType, KeyCompare >::const_iterator

Definition at line 828 of file static_set.hpp.

◆ key_compare

template<class KeyType , class KeyCompare = less<KeyType>>
typedef TBase::key_compare CStaticArraySet< KeyType, KeyCompare >::key_compare

Definition at line 830 of file static_set.hpp.

◆ size_type

template<class KeyType , class KeyCompare = less<KeyType>>
typedef TBase::size_type CStaticArraySet< KeyType, KeyCompare >::size_type

Definition at line 829 of file static_set.hpp.

◆ TBase

template<class KeyType , class KeyCompare = less<KeyType>>
typedef CStaticArraySearchBase<NStaticArray::PKeyValueSelf<KeyType>, KeyCompare> CStaticArraySet< KeyType, KeyCompare >::TBase
private

Definition at line 825 of file static_set.hpp.

◆ value_type

template<class KeyType , class KeyCompare = less<KeyType>>
typedef TBase::value_type CStaticArraySet< KeyType, KeyCompare >::value_type

Definition at line 827 of file static_set.hpp.

Constructor & Destructor Documentation

◆ CStaticArraySet() [1/6]

template<class KeyType , class KeyCompare = less<KeyType>>
template<size_t Size>
CStaticArraySet< KeyType, KeyCompare >::CStaticArraySet ( const value_type(&)  arr[Size],
const char *  file,
int  line,
NStaticArray::ECopyWarn  warn = NStaticArray::eCopyWarn_default 
)
inline

default constructor.

This will build a map 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 836 of file static_set.hpp.

◆ CStaticArraySet() [2/6]

template<class KeyType , class KeyCompare = less<KeyType>>
template<size_t Size>
CStaticArraySet< KeyType, KeyCompare >::CStaticArraySet ( const value_type(&)  arr[Size],
const key_compare comp,
const char *  file,
int  line,
NStaticArray::ECopyWarn  warn = NStaticArray::eCopyWarn_default 
)
inline

Constructor to initialize comparator object.

Definition at line 845 of file static_set.hpp.

◆ CStaticArraySet() [3/6]

template<class KeyType , class KeyCompare = less<KeyType>>
template<class Type >
CStaticArraySet< KeyType, KeyCompare >::CStaticArraySet ( const Type array_ptr,
size_t  array_size,
const char *  file,
int  line,
NStaticArray::ECopyWarn  warn = NStaticArray::eCopyWarn_default 
)
inline

default constructor.

This will build a map 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 857 of file static_set.hpp.

◆ CStaticArraySet() [4/6]

template<class KeyType , class KeyCompare = less<KeyType>>
template<class Type >
CStaticArraySet< KeyType, KeyCompare >::CStaticArraySet ( const Type array_ptr,
size_t  array_size,
const key_compare comp,
const char *  file,
int  line,
NStaticArray::ECopyWarn  warn = NStaticArray::eCopyWarn_default 
)
inline

Constructor to initialize comparator object.

Definition at line 866 of file static_set.hpp.

◆ CStaticArraySet() [5/6]

template<class KeyType , class KeyCompare >
CStaticArraySet< KeyType, KeyCompare >::CStaticArraySet ( const_iterator  obj,
size_type  array_size 
)
inline

Definition at line 907 of file static_set.hpp.

◆ CStaticArraySet() [6/6]

template<class KeyType , class KeyCompare >
CStaticArraySet< KeyType, KeyCompare >::CStaticArraySet ( const_iterator  obj,
size_type  array_size,
const key_compare comp 
)
inline

Definition at line 916 of file static_set.hpp.


The documentation for this class was generated from the following file:
Modified on Fri Apr 26 16:25:31 2024 by modify_doxy.py rev. 669887