com::sun::star::uno::Sequence< E > Class Template Reference
Template C++ class representing an IDL sequence.
More...
#include <Sequence.h>
List of all members.
Public Types |
typedef E | ElementType |
| typedefs the element type of the sequence
|
Public Member Functions |
| Sequence () throw () |
| Default constructor: Creates an empty sequence.
|
| Sequence (const Sequence< E > &rSeq) throw () |
| Copy constructor: Creates a copy of given sequence.
|
| Sequence (uno_Sequence *pSequence, __sal_NoAcquire dummy) throw () |
| Constructor: Takes over ownership of given sequence.
|
| Sequence (const E *pElements, sal_Int32 len) |
| Constructor: Creates a copy of given elements.
|
| Sequence (sal_Int32 len) |
| Constructor: Creates a default constructed sequence of given length.
|
| ~Sequence () throw () |
| Destructor: Releases sequence handle.
|
Sequence< E > & | operator= (const Sequence< E > &rSeq) throw () |
| Assignment operator: Acquires given sequence handle and releases previously set handle.
|
sal_Int32 | getLength () const throw () |
| Gets length of the sequence.
|
sal_Bool | hasElements () const throw () |
| Tests whether the sequence has elements, i.e.
|
const E * | getConstArray () const throw () |
| Gets a pointer to elements array for reading.
|
E * | getArray () |
| Gets a pointer to elements array for reading and writing.
|
E & | operator[] (sal_Int32 nIndex) |
| Non-const index operator: Obtains a reference to element indexed at given position.
|
const E & | operator[] (sal_Int32 nIndex) const throw () |
| Const index operator: Obtains a reference to element indexed at given position.
|
sal_Bool | operator== (const Sequence< E > &rSeq) const throw () |
| Equality operator: Compares two sequences.
|
sal_Bool | operator!= (const Sequence< E > &rSeq) const throw () |
| Unequality operator: Compares two sequences.
|
void | realloc (sal_Int32 nSize) |
| Reallocates sequence to new length.
|
uno_Sequence * | get () const throw () |
| Provides UNacquired sequence handle.
|
Detailed Description
template<class E>
class com::sun::star::uno::Sequence< E >
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).
- Template Parameters:
-
| E | element type of sequence |
Member Typedef Documentation
typedefs the element type of the sequence
Constructor & Destructor Documentation
Default constructor: Creates an empty sequence.
Copy constructor: Creates a copy of given sequence.
- Parameters:
-
| rSeq | another sequence of same type |
Constructor: Takes over ownership of given sequence.
- Parameters:
-
| pSequence | a sequence |
| dummy | SAL_NO_ACQUIRE to force obvious distinction to other constructors |
Constructor: Creates a copy of given elements.
- Parameters:
-
| pElements | an array of elements |
| len | length of array |
Constructor: Creates a default constructed sequence of given length.
- Parameters:
-
| len | initial sequence length |
Destructor: Releases sequence handle.
Last handle will destruct elements and free memory.
Member Function Documentation
Provides UNacquired sequence handle.
- Returns:
- UNacquired sequence handle
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.
- Returns:
- pointer to elements array
Gets a pointer to elements array for reading.
If the sequence has a length of 0, then the returned pointer is undefined.
- Returns:
- pointer to elements array
Gets length of the sequence.
- Returns:
- length of sequence
Tests whether the sequence has elements, i.e.
elements count is greater than zero.
- Returns:
- true, if elements count is greater than zero
Unequality operator: Compares two sequences.
- Parameters:
-
| rSeq | another sequence of same type (right side) |
- Returns:
- false if both sequences are equal, true otherwise
Assignment operator: Acquires given sequence handle and releases previously set handle.
- Parameters:
-
| rSeq | another sequence of same type |
- Returns:
- this sequence
Equality operator: Compares two sequences.
- Parameters:
-
| rSeq | another sequence of same type (right side) |
- Returns:
- true if both sequences are equal, false otherwise
Const index operator: Obtains a reference to element indexed at given position.
The implementation does not check for array bounds!
- Parameters:
-
- Returns:
- const C++ reference to element
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!
- Parameters:
-
- Returns:
- non-const C++ reference to element
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!
- Parameters:
-
| nSize | new size of sequence |
The documentation for this class was generated from the following files: