LibreOffice Module connectivity (master) 1
Public Types | Public Member Functions | Private Attributes | List of all members
connectivity::OSortIndex Class Reference

The class OSortIndex can be used to implement a sorted index. More...

#include <TSortIndex.hxx>

Public Types

typedef std::vector< std::pair< sal_Int32, std::unique_ptr< OKeyValue > > > TIntValuePairVector
 
typedef std::vector< OKeyTypeTKeyTypeVector
 

Public Member Functions

 OSortIndex (std::vector< OKeyType > &&_aKeyType, std::vector< TAscendingOrder > &&_aAscending)
 
 OSortIndex (OSortIndex const &)=delete
 
OSortIndexoperator= (OSortIndex const &)=delete
 
 ~OSortIndex ()
 
void AddKeyValue (std::unique_ptr< OKeyValue > pKeyValue)
 AddKeyValue appends a new value. More...
 
void Freeze ()
 Freeze freezes the sortindex so that new values could only be appended by their value. More...
 
::rtl::Reference< OKeySetCreateKeySet ()
 CreateKeySet creates the keyset which values could be used to travel in your table/result The returned keyset is frozen. More...
 
const std::vector< OKeyType > & getKeyType () const
 
TAscendingOrder getAscending (std::vector< TAscendingOrder >::size_type _nPos) const
 

Private Attributes

TIntValuePairVector m_aKeyValues
 
TKeyTypeVector m_aKeyType
 
std::vector< TAscendingOrderm_aAscending
 
bool m_bFrozen
 

Detailed Description

The class OSortIndex can be used to implement a sorted index.

This can depend on the fields which should be sorted.

Definition at line 46 of file TSortIndex.hxx.

Member Typedef Documentation

◆ TIntValuePairVector

typedef std::vector<std::pair<sal_Int32, std::unique_ptr<OKeyValue> > > connectivity::OSortIndex::TIntValuePairVector

Definition at line 49 of file TSortIndex.hxx.

◆ TKeyTypeVector

Definition at line 50 of file TSortIndex.hxx.

Constructor & Destructor Documentation

◆ OSortIndex() [1/2]

OSortIndex::OSortIndex ( std::vector< OKeyType > &&  _aKeyType,
std::vector< TAscendingOrder > &&  _aAscending 
)

Definition at line 97 of file TSortIndex.cxx.

References m_aKeyType.

◆ OSortIndex() [2/2]

connectivity::OSortIndex::OSortIndex ( OSortIndex const &  )
delete

◆ ~OSortIndex()

OSortIndex::~OSortIndex ( )

Definition at line 105 of file TSortIndex.cxx.

Member Function Documentation

◆ AddKeyValue()

void OSortIndex::AddKeyValue ( std::unique_ptr< OKeyValue pKeyValue)

AddKeyValue appends a new value.

Parameters
pKeyValuethe keyvalue to be appended ATTENTION: when the sortindex is already frozen the parameter will be deleted

Definition at line 109 of file TSortIndex.cxx.

References m_aKeyValues, and m_bFrozen.

◆ CreateKeySet()

rtl::Reference< OKeySet > OSortIndex::CreateKeySet ( )

CreateKeySet creates the keyset which values could be used to travel in your table/result The returned keyset is frozen.

Definition at line 83 of file TSortIndex.cxx.

References Freeze(), and m_aKeyValues.

◆ Freeze()

void OSortIndex::Freeze ( )

Freeze freezes the sortindex so that new values could only be appended by their value.

Definition at line 120 of file TSortIndex.cxx.

References m_aKeyType, m_aKeyValues, m_bFrozen, and connectivity::NONE.

Referenced by CreateKeySet().

◆ getAscending()

TAscendingOrder connectivity::OSortIndex::getAscending ( std::vector< TAscendingOrder >::size_type  _nPos) const
inline

Definition at line 87 of file TSortIndex.hxx.

References _nPos.

◆ getKeyType()

const std::vector< OKeyType > & connectivity::OSortIndex::getKeyType ( ) const
inline

Definition at line 86 of file TSortIndex.hxx.

References m_aKeyType.

◆ operator=()

OSortIndex & connectivity::OSortIndex::operator= ( OSortIndex const &  )
delete

Member Data Documentation

◆ m_aAscending

std::vector<TAscendingOrder> connectivity::OSortIndex::m_aAscending
private

Definition at line 55 of file TSortIndex.hxx.

◆ m_aKeyType

TKeyTypeVector connectivity::OSortIndex::m_aKeyType
private

Definition at line 54 of file TSortIndex.hxx.

Referenced by Freeze().

◆ m_aKeyValues

TIntValuePairVector connectivity::OSortIndex::m_aKeyValues
private

Definition at line 53 of file TSortIndex.hxx.

Referenced by AddKeyValue(), CreateKeySet(), and Freeze().

◆ m_bFrozen

bool connectivity::OSortIndex::m_bFrozen
private

Definition at line 56 of file TSortIndex.hxx.

Referenced by AddKeyValue(), and Freeze().


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