LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
|
Template C++ class representing an IDL sequence. More...
#include <unotype.hxx>
Public Types | |
typedef E | ElementType |
typedefs the element type of the sequence More... | |
Public Member Functions | |
Sequence () | |
Default constructor: Creates an empty sequence. More... | |
Sequence (const Sequence &rSeq) | |
Copy constructor: Creates a copy of given sequence. More... | |
Sequence (uno_Sequence *pSequence, __sal_NoAcquire dummy) | |
Constructor: Takes over ownership of given sequence. More... | |
Sequence (const E *pElements, sal_Int32 len) | |
Constructor: Creates a copy of given elements. More... | |
Sequence (sal_Int32 len) | |
Constructor: Creates a default constructed sequence of given length. More... | |
~Sequence () | |
Destructor: Releases sequence handle. More... | |
Sequence & | operator= (const Sequence &rSeq) |
Assignment operator: Acquires given sequence handle and releases previously set handle. More... | |
sal_Int32 | getLength () const |
Gets length of the sequence. More... | |
bool | hasElements () const |
Tests whether the sequence has elements, i.e. More... | |
const E * | getConstArray () const |
Gets a pointer to elements array for reading. More... | |
E * | getArray () |
Gets a pointer to elements array for reading and writing. More... | |
E * | begin () |
This function allows to use Sequence in standard algorithms, like std::find and others. More... | |
E const * | begin () const |
This function allows to use Sequence in standard algorithms, like std::find and others. More... | |
E * | end () |
This function allows to use Sequence in standard algorithms, like std::find and others. More... | |
E const * | end () const |
This function allows to use Sequence in standard algorithms, like std::find and others. More... | |
E & | operator[] (sal_Int32 nIndex) |
Non-const index operator: Obtains a reference to element indexed at given position. More... | |
const E & | operator[] (sal_Int32 nIndex) const |
Const index operator: Obtains a reference to element indexed at given position. More... | |
bool | operator== (const Sequence &rSeq) const |
Equality operator: Compares two sequences. More... | |
bool | operator!= (const Sequence &rSeq) const |
Inequality operator: Compares two sequences. More... | |
void | realloc (sal_Int32 nSize) |
Reallocates sequence to new length. More... | |
uno_Sequence * | get () const |
Provides UNacquired sequence handle. More... | |
Template C++ class representing an IDL sequence.
Template argument is the sequence element type. C++ Sequences are reference counted and shared, so the sequence keeps a handle to its data. To keep value semantics, copies are only generated if the sequence is to be modified (new handle).
E | element type of sequence |
typedef E com::sun::star::uno::Sequence< E >::ElementType |
typedefs the element type of the sequence
|
inline |
Default constructor: Creates an empty sequence.
|
inline |
Copy constructor: Creates a copy of given sequence.
rSeq | another sequence of same type |
|
inline |
Constructor: Takes over ownership of given sequence.
pSequence | a sequence |
dummy | SAL_NO_ACQUIRE to force obvious distinction to other constructors |
|
inline |
Constructor: Creates a copy of given elements.
pElements | an array of elements |
len | length of array |
|
inlineexplicit |
Constructor: Creates a default constructed sequence of given length.
len | initial sequence length |
|
inline |
Destructor: Releases sequence handle.
Last handle will destruct elements and free memory.
|
inline |
This function allows to use Sequence in standard algorithms, like std::find and others.
|
inline |
This function allows to use Sequence in standard algorithms, like std::find and others.
|
inline |
This function allows to use Sequence in standard algorithms, like std::find and others.
|
inline |
This function allows to use Sequence in standard algorithms, like std::find and others.
|
inline |
Provides UNacquired sequence handle.
|
inline |
Gets a pointer to elements array for reading and writing.
In general if the sequence has a handle acquired by other sequences (reference count > 1), then a new sequence is created copy constructing all elements to keep value semantics! If the sequence has a length of 0, then the returned pointer is undefined.
|
inline |
Gets a pointer to elements array for reading.
If the sequence has a length of 0, then the returned pointer is undefined.
|
inline |
Gets length of the sequence.
|
inline |
Tests whether the sequence has elements, i.e.
elements count is greater than zero.
|
inline |
Inequality operator: Compares two sequences.
rSeq | another sequence of same type (right side) |
|
inline |
Assignment operator: Acquires given sequence handle and releases previously set handle.
rSeq | another sequence of same type |
|
inline |
Equality operator: Compares two sequences.
rSeq | another sequence of same type (right side) |
|
inline |
Non-const index operator: Obtains a reference to element indexed at given position.
The implementation does not check for array bounds! In general if the sequence has a handle acquired by other sequences (reference count > 1), then a new sequence is created copy constructing all elements to keep value semantics!
nIndex | index |
|
inline |
Const index operator: Obtains a reference to element indexed at given position.
The implementation does not check for array bounds!
nIndex | index |
|
inline |
Reallocates sequence to new length.
If the new length is smaller than the former, then upper elements will be destructed (and their memory freed). If the new length is greater than the former, then upper (new) elements are default constructed. If the sequence has a handle acquired by other sequences (reference count > 1), then the remaining elements are copy constructed to a new sequence handle to keep value semantics!
nSize | new size of sequence |