(incubating) | The Free and Open Productivity Suite

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous

Content for OpenOffice.org version 3.3.

:: com :: sun :: star :: uno ::

template< typename E >

class Sequence


Base Classes
None.
Known Derived Classes
None.

virtual abstract interface template
NO NO NO YES
Description
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
File
Sequence.h

Public Members

Typedefs

ElementType typedefs the element type of the sequence

Methods


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 ) 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. Last handle will destruct elements and free memory.
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. elements count is greater than zero.
const E *
getConstArray( ) const throw( );
E *
getArray( );
E &
operator[]( sal_Int32 nIndex );
const E &
operator[]( sal_Int32 nIndex ) const throw( );
Const index operator: Obtains a reference to element indexed at given position. The implementation does not check for array bounds!
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 );
uno_Sequence *
get( ) const throw( );
Provides UNacquired sequence handle.

Top of Page

Apache OpenOffice is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright & License
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.