LibreOffice Module svl (master) 1
Public Types | Public Member Functions | Public Attributes | List of all members
WhichRangesContainer Struct Reference

Most of the time, the which ranges we point at are a compile-time literal. More...

#include <whichranges.hxx>

Public Types

using const_iterator = WhichPair const *
 

Public Member Functions

 WhichRangesContainer ()=default
 
 WhichRangesContainer (std::unique_ptr< WhichPair[]> wids, sal_Int32 nSize)
 
template<sal_uInt16... WIDs>
 WhichRangesContainer (svl::Items_t< WIDs... >)
 
 WhichRangesContainer (const WhichPair *wids, sal_Int32 nSize)
 
 WhichRangesContainer (sal_uInt16 nWhichStart, sal_uInt16 nWhichEnd)
 
 WhichRangesContainer (WhichRangesContainer const &other)
 
 WhichRangesContainer (WhichRangesContainer &&other)
 
 ~WhichRangesContainer ()
 
WhichRangesContaineroperator= (WhichRangesContainer &&other)
 
WhichRangesContaineroperator= (WhichRangesContainer const &other)
 
bool operator== (WhichRangesContainer const &other) const
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
bool empty () const noexcept
 
sal_Int32 size () const noexcept
 
WhichPair const & operator[] (sal_Int32 idx) const noexcept
 
void reset ()
 
SAL_WARN_UNUSED_RESULT WhichRangesContainer MergeRange (sal_uInt16 nFrom, sal_uInt16 nTo) const
 

Public Attributes

WhichPair const * m_pairs = nullptr
 
sal_Int32 m_size = 0
 
bool m_bOwnRanges = false
 if true, we allocated and need to delete the pairs, if not, we are pointing at a global const literal More...
 

Detailed Description

Most of the time, the which ranges we point at are a compile-time literal.

So we take advantage of that, and avoid the cost of allocating our own array and copying into it.

Definition at line 78 of file whichranges.hxx.

Member Typedef Documentation

◆ const_iterator

Definition at line 80 of file whichranges.hxx.

Constructor & Destructor Documentation

◆ WhichRangesContainer() [1/7]

WhichRangesContainer::WhichRangesContainer ( )
default

Referenced by MergeRange().

◆ WhichRangesContainer() [2/7]

WhichRangesContainer::WhichRangesContainer ( std::unique_ptr< WhichPair[]>  wids,
sal_Int32  nSize 
)
inline

Definition at line 90 of file whichranges.hxx.

◆ WhichRangesContainer() [3/7]

template<sal_uInt16... WIDs>
WhichRangesContainer::WhichRangesContainer ( svl::Items_t< WIDs... >  )
inline

Definition at line 97 of file whichranges.hxx.

References size, and value.

◆ WhichRangesContainer() [4/7]

WhichRangesContainer::WhichRangesContainer ( const WhichPair wids,
sal_Int32  nSize 
)

Definition at line 1440 of file itemset.cxx.

References i, m_bOwnRanges, m_pairs, m_size, and p.

◆ WhichRangesContainer() [5/7]

WhichRangesContainer::WhichRangesContainer ( sal_uInt16  nWhichStart,
sal_uInt16  nWhichEnd 
)

Definition at line 1450 of file itemset.cxx.

References m_pairs, and p.

◆ WhichRangesContainer() [6/7]

WhichRangesContainer::WhichRangesContainer ( WhichRangesContainer const &  other)
inline

Definition at line 105 of file whichranges.hxx.

◆ WhichRangesContainer() [7/7]

WhichRangesContainer::WhichRangesContainer ( WhichRangesContainer &&  other)

Definition at line 1458 of file itemset.cxx.

References m_bOwnRanges, m_pairs, and m_size.

◆ ~WhichRangesContainer()

WhichRangesContainer::~WhichRangesContainer ( )

Definition at line 1490 of file itemset.cxx.

References reset().

Member Function Documentation

◆ begin()

const_iterator WhichRangesContainer::begin ( ) const
inlinenoexcept

◆ empty()

bool WhichRangesContainer::empty ( ) const
inlinenoexcept

Definition at line 115 of file whichranges.hxx.

Referenced by MergeRange(), SfxItemSet::SfxItemSet(), and SfxItemSet::~SfxItemSet().

◆ end()

const_iterator WhichRangesContainer::end ( ) const
inlinenoexcept

Definition at line 114 of file whichranges.hxx.

References begin, and size.

◆ MergeRange()

WhichRangesContainer WhichRangesContainer::MergeRange ( sal_uInt16  nFrom,
sal_uInt16  nTo 
) const

◆ operator=() [1/2]

WhichRangesContainer & WhichRangesContainer::operator= ( WhichRangesContainer &&  other)

Definition at line 1465 of file itemset.cxx.

References m_bOwnRanges, m_pairs, and m_size.

◆ operator=() [2/2]

WhichRangesContainer & WhichRangesContainer::operator= ( WhichRangesContainer const &  other)

Definition at line 1473 of file itemset.cxx.

References i, m_bOwnRanges, m_pairs, m_size, p, and reset().

◆ operator==()

bool WhichRangesContainer::operator== ( WhichRangesContainer const &  other) const

Definition at line 1495 of file itemset.cxx.

References m_pairs, and m_size.

◆ operator[]()

WhichPair const & WhichRangesContainer::operator[] ( sal_Int32  idx) const
inlinenoexcept

Definition at line 117 of file whichranges.hxx.

References idx, and size.

◆ reset()

void WhichRangesContainer::reset ( )

◆ size()

sal_Int32 WhichRangesContainer::size ( ) const
inlinenoexcept

Member Data Documentation

◆ m_bOwnRanges

bool WhichRangesContainer::m_bOwnRanges = false

if true, we allocated and need to delete the pairs, if not, we are pointing at a global const literal

Definition at line 86 of file whichranges.hxx.

Referenced by operator=(), reset(), and WhichRangesContainer().

◆ m_pairs

WhichPair const* WhichRangesContainer::m_pairs = nullptr

Definition at line 82 of file whichranges.hxx.

Referenced by operator=(), operator==(), reset(), and WhichRangesContainer().

◆ m_size

sal_Int32 WhichRangesContainer::m_size = 0

Definition at line 83 of file whichranges.hxx.

Referenced by operator=(), operator==(), reset(), and WhichRangesContainer().


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