23#ifndef INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_HXX 
   24#define INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_HXX 
   30#if defined LIBO_INTERNAL_ONLY 
   31# include <type_traits> 
   70    osl_atomic_increment( &rSeq._pSequence->
nRefCount );
 
   71    _pSequence = rSeq._pSequence;
 
 
   77        : _pSequence( pSequence )
 
 
   91        throw ::std::bad_alloc();
 
 
  103        throw ::std::bad_alloc();
 
  106#if defined LIBO_INTERNAL_ONLY 
  110            const_cast<E *
>(init.begin()), init.size(), 
cpp_acquire))
 
  112        throw std::bad_alloc();
 
  120    if (osl_atomic_decrement( &_pSequence->nRefCount ) == 0)
 
  137#if defined LIBO_INTERNAL_ONLY 
  139    std::swap(_pSequence, other._pSequence);
 
  147    if (_pSequence == rSeq._pSequence)
 
  149    if (_pSequence->nElements != rSeq._pSequence->
nElements)
 
  152    return ::uno_type_equalData(
 
 
  162    return (! 
operator == ( rSeq ));
 
 
  174        throw ::std::bad_alloc();
 
  175    return reinterpret_cast< E * 
>( _pSequence->elements );
 
 
  178#if !defined LIBO_INTERNAL_ONLY 
  185#if !defined LIBO_INTERNAL_ONLY 
  192#if !defined LIBO_INTERNAL_ONLY 
  197    assert(nIndex >= 0 && 
static_cast<sal_uInt32
>(nIndex) < 
static_cast<sal_uInt32
>(
getLength()));
 
  206    assert(nIndex >= 0 && 
static_cast<sal_uInt32
>(nIndex) < 
static_cast<sal_uInt32
>(
getLength()));
 
  207    return reinterpret_cast< const E * 
>( _pSequence->elements )[ nIndex ];
 
  219        throw ::std::bad_alloc();
 
  222#if defined LIBO_INTERNAL_ONLY 
  223template <
class E> 
inline void Sequence<E>::swap(Sequence& other)
 
  225    std::swap(_pSequence, other._pSequence);
 
  230    const ::rtl::ByteSequence & rByteSequence )
 
  232    return * 
reinterpret_cast< const ::com::sun::star::uno::Sequence< sal_Int8 > * 
>( &rByteSequence );
 
 
  235#if defined LIBO_INTERNAL_ONLY 
  239namespace uno_detail {
 
  241template< 
typename value_t, 
typename charT, 
typename traits >
 
  242void sequence_output_elems( std::basic_ostream<charT, traits> &os, 
const value_t *pAry, sal_Int32 nLen, std::true_type )
 
  245    auto const flags = os.setf(std::ios_base::hex);
 
  246    for(sal_Int32 i=0; i<nLen-1; ++i)
 
  247        os << 
"0x" << *pAry++ << 
", ";
 
  249        os << 
"0x" << *pAry++;
 
  253template< 
typename value_t, 
typename charT, 
typename traits >
 
  254void sequence_output_elems( std::basic_ostream<charT, traits> &os, 
const value_t *pAry, sal_Int32 nLen, std::false_type )
 
  257    for(sal_Int32 i=0; i<nLen-1; ++i)
 
  258        os << *pAry++ << 
", ";
 
  263template< 
typename value_t, 
typename charT, 
typename traits >
 
  264void sequence_output_bytes( std::basic_ostream<charT, traits> &os, 
const value_t *pAry, sal_Int32 nLen )
 
  268    auto const flags = os.setf(std::ios_base::hex);
 
  269    for(sal_Int32 i=0; i<nLen-1; ++i)
 
  270        os << 
"0x" << (0xFF & +*pAry++) << 
", ";
 
  272        os << 
"0x" << (0xFF & +*pAry++);
 
  284template< 
typename value_t, 
typename charT, 
typename traits >
 
  289    if constexpr (std::is_same<sal_Int8, value_t>::value) {
 
  290        uno_detail::sequence_output_bytes(os, pAry, nLen);
 
  292        uno_detail::sequence_output_elems(os, pAry, nLen, std::is_integral<value_t>());
 
  303    struct SequenceRange : 
public std::pair<E*, E*>
 
  305        SequenceRange(E* ptr, sal_Int32 len) : std::pair<E*, E*>(ptr, ptr + len) {}
 
  307        E* begin() { 
return std::pair<E*, E*>::first; }
 
  308        E* end() { 
return std::pair<E*, E*>::second; }
 
  309        E& operator[](sal_Int32 i) { assert(i >= 0 && i < end() - begin()); 
return begin()[i]; }
 
  325template< 
typename T > inline ::com::sun::star::uno::Type 
const &
 
  327    SAL_UNUSED_PARAMETER ::com::sun::star::uno::Sequence< T > 
const *)
 
  334                typename ::com::sun::star::uno::Sequence< T >::ElementType * 
>(
 
 
  342template< 
typename T > inline ::com::sun::star::uno::Type 
const &
 
  344    SAL_UNUSED_PARAMETER ::com::sun::star::uno::Sequence< T > 
const *)
 
  354                typename ::com::sun::star::uno::Sequence< T >::ElementType * 
>(
 
 
  365inline const ::com::sun::star::uno::Type &
 
  369    return ::cppu::getTypeFavourUnsigned(
 
 
  375inline const ::com::sun::star::uno::Type &
 
  382            rElementType.getTypeLibType() );
 
 
  389inline const ::com::sun::star::uno::Type &
 
  393    if (! s_pType_com_sun_star_uno_Sequence_Char)
 
  397            & s_pType_com_sun_star_uno_Sequence_Char,
 
  398            rElementType.getTypeLibType() );
 
  401        & s_pType_com_sun_star_uno_Sequence_Char );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
__sal_NoAcquire
Definition types.h:371
#define SAL_UNUSED_PARAMETER
Annotate unused but required C++ function parameters.
Definition types.h:592
CPPU_DLLPUBLIC void typelib_static_sequence_type_init(typelib_TypeDescriptionReference **ppRef, typelib_TypeDescriptionReference *pElementType) SAL_THROW_EXTERN_C()
Inits static sequence type reference.
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
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.
sal_Sequence uno_Sequence
Definition sequence2.h:36
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.
CPPU_DLLPUBLIC void uno_type_sequence_destroy(uno_Sequence *sequence, struct _typelib_TypeDescriptionReference *type, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
Destroy a sequence whose reference count has dropped to zero.
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.
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.
const ::com::sun::star::uno::Type & getCharSequenceCppuType()
Gets the meta type of IDL sequence< char >.
Definition Sequence.hxx:390
const ::com::sun::star::uno::Type & getCppuSequenceType(const ::com::sun::star::uno::Type &rElementType)
Gets the meta type of IDL sequence.
Definition Sequence.hxx:376
const ::com::sun::star::uno::Type & getCppuType()
Gets the meta type of an IDL type.
Definition Type.hxx:218
Definition typedescription.hxx:43
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:229
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &o, Any const &any)
Support for Any in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO macros, for example).
Definition Any.hxx:708
void cpp_release(void *pCppI)
Function to release a C++ interface.
Definition genfunc.hxx:50
void * cpp_queryInterface(void *pCppI, typelib_TypeDescriptionReference *pType)
Function to query for a C++ interface.
Definition genfunc.hxx:55
void cpp_acquire(void *pCppI)
Function to acquire a C++ interface.
Definition genfunc.hxx:45
Definition Enterable.hxx:31
css::uno::Type const & getTypeFavourUnsigned(SAL_UNUSED_PARAMETER T const *)
A working replacement for getCppuType (see there).
Definition unotype.hxx:324
::com::sun::star::uno::Type const & getTypeFavourChar(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Sequence< T > const *)
Definition Sequence.hxx:343
css::uno::Type const & getTypeFromTypeDescriptionReference(::typelib_TypeDescriptionReference *const *tdr)
Definition unotype.hxx:105
sal_Int32 nRefCount
reference count of sequence
Definition types.h:325
sal_Int32 nElements
element count
Definition types.h:328
Template C++ class representing an IDL sequence.
Definition Sequence.h:61
~Sequence()
Destructor: Releases sequence handle.
Definition Sequence.hxx:118
bool operator==(const Sequence &rSeq) const
Equality operator: Compares two sequences.
Definition Sequence.hxx:145
const E * getConstArray() const
Gets a pointer to elements array for reading.
Definition Sequence.h:178
sal_Int32 getLength() const
Gets length of the sequence.
Definition Sequence.h:152
E * begin()
This function allows to use Sequence in standard algorithms, like std::find and others.
Definition Sequence.hxx:179
E & operator[](sal_Int32 nIndex)
Non-const index operator: Obtains a reference to element indexed at given position.
Definition Sequence.hxx:194
E * end()
This function allows to use Sequence in standard algorithms, like std::find and others.
Definition Sequence.hxx:186
E * getArray()
Gets a pointer to elements array for reading and writing.
Definition Sequence.hxx:166
bool operator!=(const Sequence &rSeq) const
Inequality operator: Compares two sequences.
Definition Sequence.hxx:160
Sequence()
Default constructor: Creates an empty sequence.
Definition Sequence.hxx:58
Sequence & operator=(const Sequence &rSeq)
Assignment operator: Acquires given sequence handle and releases previously set handle.
Definition Sequence.hxx:129
void realloc(sal_Int32 nSize)
Reallocates sequence to new length.
Definition Sequence.hxx:211
static css::uno::Type const & get()
Definition unotype.hxx:292
C++ class representing an IDL meta type.
Definition Type.h:59
typelib_TypeDescriptionReference * getTypeLibType() const
Gets the C typelib type description reference pointer.
Definition Type.h:162