namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
/** Template C++ class representing an IDL sequence. Template argument is the sequenceelementtype.C++Sequencesarereferencecountedandshared, sothesequencekeepsahandletoitsdata.Tokeepvaluesemantics, copiesareonlygeneratedifthesequenceistobemodified(newhandle).
@tparamEelementtypeofsequence
*/ template< class E > class SAL_WARN_UNUSED SAL_DLLPUBLIC_RTTI Sequence
{ /** sequence handle
*/
uno_Sequence * _pSequence;
public: /// @cond INTERNAL
// these are here to force memory de/allocation to sal lib. staticvoid * SAL_CALL operatornew ( ::size_t nSize )
{ return ::rtl_allocateMemory( nSize ); } staticvoid SAL_CALL operatordelete ( void * pMem )
{ ::rtl_freeMemory( pMem ); } staticvoid * SAL_CALL operatornew ( ::size_t, void * pMem )
{ return pMem; } staticvoid SAL_CALL operatordelete ( void *, void * )
{}
/** Static pointer to typelib type of sequence. Don'tusedirectly,callgetCppuType().
*/ static typelib_TypeDescriptionReference * s_pType;
/// @endcond
/** typedefs the element type of the sequence
*/ typedef E ElementType;
/** Default constructor: Creates an empty sequence.
*/ inline Sequence();
/** Copy constructor: Creates a copy of given sequence.
/** Gets a pointer to elements array for reading. Ifthesequencehasalengthof0,thenthereturnedpointeris undefined.
@returnpointertoelementsarray
*/ const E * SAL_CALL getConstArray() const
{ returnreinterpret_cast< const E * >( _pSequence->elements ); }
/** Gets a pointer to elements array for reading and writing. Ingeneralifthesequencehasahandleacquiredbyothersequences (referencecount>1),thenanewsequenceiscreatedcopyconstructing allelementstokeepvaluesemantics! Ifthesequencehasalengthof0,thenthereturnedpointeris undefined.
@returnpointertoelementsarray
*/ inline E * SAL_CALL getArray();
#if !defined LIBO_INTERNAL_ONLY /** This function allows to use Sequence in standard algorithms, like std::find andothers.
@sinceLibreOffice4.2
*/ inline E * begin(); #endif
/** This function allows to use Sequence in standard algorithms, like std::find andothers.
@sinceLibreOffice4.2
*/ inline E const * begin() const;
#if !defined LIBO_INTERNAL_ONLY /** This function allows to use Sequence in standard algorithms, like std::find andothers.
@sinceLibreOffice4.2
*/ inline E * end(); #endif
/** This function allows to use Sequence in standard algorithms, like std::find andothers.
@sinceLibreOffice4.2
*/ inline E const * end() const;
// Non-const operator[] is not available in internal code. Consider explicit use // of getArray(), out of tight loops if possible to avoid unneeded COW overhead. #if !defined LIBO_INTERNAL_ONLY /** Non-const index operator: Obtains a reference to element indexed at givenposition. Theimplementationdoesnotcheckforarraybounds! Ingeneralifthesequencehasahandleacquiredbyothersequences (referencecount>1),thenanewsequenceiscreatedcopyconstructing allelementstokeepvaluesemantics!
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.