doubt regarding data type.

Tadeus Prastowo tadeus.prastowo at unitn.it
Tue Sep 11 11:22:17 UTC 2018


On Tue, Sep 11, 2018 at 1:06 PM, Rahul Gurung <gurungrahul2 at gmail.com> wrote:
> Hey,
>
>
> Thanks but can you elaborate a little more about sequence ? What it really
> is and how is effects the data type or its functions ?

I have never used an uno::Sequence object before.  So, guessing from
the name, the object is a container object, holding a collection of
objects.  Some examples (assuming that my guess is correct) are below:

uno::Sequence<table::CellRangeAddress> collectionOfAddresses;
uno::Sequence<std::string> collectionOfStandardCppStrings;
struct IntegerWrapper {
  int value;
};
uno::Sequence<IntegerWrapper> collectionOfIntValues;
uno::Sequence<uno::Sequence<std::string>> collectionOfCollectionsOfStrings;

A container object affects neither the data type nor the functions of
the contained objects.  Instead, a container object provides
facilities to deal with a collection of objects, for example, to
iterate over all of the contained objects as illustrated below
(assuming my guess is correct tnat uno::Sequence class defines the
`begin' and `end' member functions):

uno::Sequence<std::string> collectionOfStandardCppStrings;
// fill in collectionOfStandardCppStrings with std::string objects
for (auto itr = collectionOfStandardCppStrings.begin();
     itr != collectionOfStandardCppStrings.end(); ++itr) {
  std::cout << *itr << '\n';
}

--
Best regards,
Tadeus

> On 11 September 2018 at 14:39, Tadeus Prastowo <tadeus.prastowo at unitn.it>
> wrote:
>>
>> On Tue, Sep 11, 2018 at 9:49 AM, Rahul Gurung <gurungrahul2 at gmail.com>
>> wrote:
>> > Hey,
>> >
>> > What is difference between variable declared as
>> >
>> > uno::Sequence<table::CellRangeAddress> aRanges;
>>
>> aRanges is a variable of an uno::Sequence object.  The object is
>> likely a sequence of a table::CellRangeAddress objects.
>>
>> > and a simple one as
>> >
>> > table::CellRangeAddress aRanges;
>>
>> aRanges is a variable of a single table::CellRangeAddress object.
>>
>> > Thanks,
>> > RG
>>
>> --
>> Best regards,
>> Tadeus


More information about the LibreOffice mailing list