19 #ifndef INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_HXX
20 #define INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_HXX
60 osl_atomic_increment( &rSeq._pSequence->nRefCount );
61 _pSequence = rSeq._pSequence;
67 : _pSequence( pSequence )
80 throw ::std::bad_alloc();
92 throw ::std::bad_alloc();
116 if (_pSequence == rSeq._pSequence)
130 return (!
operator == ( rSeq ));
142 throw ::std::bad_alloc();
143 return reinterpret_cast< E *
>( _pSequence->elements );
149 {
return getConstArray(); }
154 {
return begin() + getLength(); }
159 assert( nIndex >= 0 && nIndex < getLength() );
160 return getArray()[ nIndex ];
167 assert( nIndex >= 0 && nIndex < getLength() );
168 return reinterpret_cast< const E *
>( _pSequence->elements )[ nIndex ];
180 throw ::std::bad_alloc();
184 const ::rtl::ByteSequence & rByteSequence )
SAL_THROW(())
186 return ::com::sun::star::uno::Sequence< sal_Int8 >(
187 *
reinterpret_cast< const ::com::sun::star::uno::Sequence< sal_Int8 > *
>( &rByteSequence ) );
197 template<
typename T > inline ::com::sun::star::uno::Type
const &
199 SAL_UNUSED_PARAMETER ::com::sun::star::uno::Sequence< T >
const *)
206 typename ::com::sun::star::uno::Sequence< T >::ElementType *
>(
214 template<
typename T > inline ::com::sun::star::uno::Type
const &
216 SAL_UNUSED_PARAMETER ::com::sun::star::uno::Sequence< T >
const *)
226 typename ::com::sun::star::uno::Sequence< T >::ElementType *
>(
237 inline const ::com::sun::star::uno::Type &
248 inline const ::com::sun::star::uno::Type &
256 rElementType.getTypeLibType() );
262 #if (defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500))
267 inline const ::com::sun::star::uno::Type &
270 #if !( defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500))
273 if (! s_pType_com_sun_star_uno_Sequence_Char)
277 & s_pType_com_sun_star_uno_Sequence_Char,
278 rElementType.getTypeLibType() );
281 & s_pType_com_sun_star_uno_Sequence_Char );
void realloc(sal_Int32 nSize)
Reallocates sequence to new length.
Definition: Sequence.hxx:172
void cpp_acquire(void *pCppI)
Function to acquire a C++ interface.
Definition: genfunc.hxx:36
CPPU_DLLPUBLIC void typelib_static_sequence_type_init(typelib_TypeDescriptionReference **ppRef, typelib_TypeDescriptionReference *pElementType) SAL_THROW_EXTERN_C()
Inits static sequence type reference.
CPPU_DLLPUBLIC sal_Bool uno_type_sequence_realloc(uno_Sequence **ppSequence, struct _typelib_TypeDescriptionReference *pType, sal_Int32 nSize, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Reallocates length of a sequence.
Holds a weak reference to a type description.
Definition: typedescription.h:40
#define SAL_UNUSED_PARAMETER
Annotate unused but required C++ function parameters.
Definition: types.h:570
C++ class representing an IDL meta type.
Definition: Type.h:55
CPPU_DLLPUBLIC sal_Bool uno_type_sequence_construct(uno_Sequence **ppSequence, struct _typelib_TypeDescriptionReference *pType, void *pElements, sal_Int32 len, uno_AcquireFunc acquire) SAL_THROW_EXTERN_C()
Constructs a new sequence with given elements.
#define sal_True
Definition: types.h:48
inline::com::sun::star::uno::Sequence< sal_Int8 > toUnoSequence(const ::rtl::ByteSequence &rByteSequence)
Creates a UNO byte sequence from a SAL byte sequence.
Definition: Sequence.hxx:183
void *(* uno_QueryInterfaceFunc)(void *pInterface, struct _typelib_TypeDescriptionReference *pType)
Generic function pointer declaration to query for an interface.
Definition: data.h:40
void cpp_release(void *pCppI)
Function to release a C++ interface.
Definition: genfunc.hxx:42
const ::com::sun::star::uno::Type & getCppuSequenceType(const ::com::sun::star::uno::Type &rElementType)
Gets the meta type of IDL sequence.
Definition: Sequence.hxx:249
E * end()
This function allows to use Sequence in standard algorightms, like std::find and others.
Definition: Sequence.hxx:151
void(* uno_ReleaseFunc)(void *pInterface)
Generic function pointer declaration to release an interface.
Definition: data.h:52
const ::com::sun::star::uno::Type & getCharSequenceCppuType()
Gets the meta type of IDL sequence< char >.
Definition: Sequence.hxx:268
::com::sun::star::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition: unotype.hxx:287
::com::sun::star::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER::com::sun::star::uno::Sequence< T > const *)
Definition: Sequence.hxx:198
const ::com::sun::star::uno::Type & getCharCppuType()
Gets the meta type of IDL type char.
Definition: Type.hxx:130
sal_Bool operator!=(const Sequence< E > &rSeq) const
Unequality operator: Compares two sequences.
Definition: Sequence.hxx:127
sal_Bool operator==(const Sequence< E > &rSeq) const
Equality operator: Compares two sequences.
Definition: Sequence.hxx:113
This is the binary specification of a SAL sequence.
Definition: types.h:325
::com::sun::star::uno::Type const & getTypeFavourChar(SAL_UNUSED_PARAMETER::com::sun::star::uno::Sequence< T > const *)
Definition: Sequence.hxx:215
Sequence()
Default constructor: Creates an empty sequence.
Definition: Sequence.hxx:48
CPPU_DLLPUBLIC sal_Bool uno_type_equalData(void *pVal1, struct _typelib_TypeDescriptionReference *pVal1Type, void *pVal2, struct _typelib_TypeDescriptionReference *pVal2Type, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Tests if two values are equal.
E & operator[](sal_Int32 nIndex)
Non-const index operator: Obtains a reference to element indexed at given position.
Definition: Sequence.hxx:157
inline::com::sun::star::uno::Type const & getTypeFromTypeDescriptionReference(::typelib_TypeDescriptionReference *const *tdr)
Definition: unotype.hxx:94
CPPU_DLLPUBLIC void uno_type_sequence_assign(uno_Sequence **ppDest, uno_Sequence *pSource, struct _typelib_TypeDescriptionReference *pType, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Assigns a sequence.
unsigned char sal_Bool
Definition: types.h:46
__sal_NoAcquire
Definition: types.h:372
E * begin()
This function allows to use Sequence in standard algorightms, like std::find and others.
Definition: Sequence.hxx:146
void(* uno_AcquireFunc)(void *pInterface)
Generic function pointer declaration to acquire an interface.
Definition: data.h:46
CPPU_DLLPUBLIC sal_Bool uno_type_sequence_reference2One(uno_Sequence **ppSequence, struct _typelib_TypeDescriptionReference *pType, uno_AcquireFunc acquire, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Assures that the reference count of the given sequence is one.
~Sequence()
Destructor: Releases sequence handle.
Definition: Sequence.hxx:96
CPPU_DLLPUBLIC void uno_type_destructData(void *pValue, struct _typelib_TypeDescriptionReference *pType, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Destructs a given value; does NOT free its memory!
Sequence< E > & operator=(const Sequence< E > &rSeq)
Assignment operator: Acquires given sequence handle and releases previously set handle.
Definition: Sequence.hxx:104
E * getArray()
Gets a pointer to elements array for reading and writing.
Definition: Sequence.hxx:134
void * cpp_queryInterface(void *pCppI, typelib_TypeDescriptionReference *pType)
Function to query for a C++ interface.
Definition: genfunc.hxx:48
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition: Type.h:155
Template C++ class representing an IDL sequence.
Definition: unotype.hxx:33
const ::com::sun::star::uno::Type & getCppuType(SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Sequence< E > *)
Definition: Sequence.hxx:238
#define SAL_THROW(exc)
Definition of function throw clause macros.
Definition: types.h:358