Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/include/o3tl/enumarray.hxx
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#ifndef INCLUDED_O3TL_ENUMARRAY_HXX
21
#define INCLUDED_O3TL_ENUMARRAY_HXX
22
23
#include <iterator>
24
#include <type_traits>
25
#include <utility>
26
#include <array>
27
#include <cassert>
28
29
namespace o3tl {
30
31
template<typename EA>
32
class enumarray_iterator;
33
template<typename EA>
34
class enumarray_const_iterator;
35
36
///
37
/// This is a container convenience class for arrays indexed by enum values.
38
///
39
/// This assumes that the 'enum class' definition
40
///  - starts at zero
41
///  - has no holes in its sequence of values
42
///  - defines a value called LAST which refers to the greatest constant.
43
///
44
/// \param E the 'enum class' type.
45
/// \param V the value type to be stored in the array
46
template<typename E, typename V>
47
class enumarray final
48
{
49
public:
50
    typedef enumarray<E, V> self_type;
51
    typedef enumarray_iterator<self_type> iterator;
52
    typedef enumarray_const_iterator<self_type> const_iterator;
53
54
    typedef V             value_type;
55
    typedef E             key_type;
56
    typedef size_t        size_type;
57
58
    static const size_type max_index = static_cast<size_type>(E::LAST);
59
60
    // If this ctor only had the args parameter pack, it would erroneously get picked as a better
61
    // choice than the (implicit) copy ctor (taking a const lvalue reference) when a copy is made
62
    // from a non-const lvalue enumarray; the easiest way to avoid that is the additional arg
63
    // parameter; and to keep things simple that parameter is always passed by const lvalue
64
    // reference for now even if there could be cases where passing it by rvalue reference might be
65
    // beneficial or even necessary if V is a move-only type:
66
    template<typename... T> constexpr enumarray(V const & arg, T && ...args):
67
0
        detail_values{arg, std::forward<T>(args)...}
68
0
    {
69
0
        static_assert(sizeof... (T) == max_index);
70
0
    }
71
72
    // coverity[uninit_ctor] - by design:
73
1.57M
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<VclPackType, std::__1::vector<vcl::Window*, std::__1::allocator<vcl::Window*> > >::enumarray()
Unexecuted instantiation: o3tl::enumarray<MetaActionType, bool>::enumarray()
o3tl::enumarray<vcl::EnumContext::Application, rtl::OUString>::enumarray()
Line
Count
Source
73
108
    enumarray() {}
o3tl::enumarray<vcl::EnumContext::Context, rtl::OUString>::enumarray()
Line
Count
Source
73
108
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<SvImpLBox::ImageType, Image>::enumarray()
o3tl::enumarray<SvtPathOptions::Paths, rtl::OUString>::enumarray()
Line
Count
Source
73
6
    enumarray() {}
moduleoptions.cxx:o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>::enumarray()
Line
Count
Source
73
10
    enumarray() {}
o3tl::enumarray<oox::xls::Unit, double>::enumarray()
Line
Count
Source
73
4.74k
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<ScContentId, bool>::enumarray()
Unexecuted instantiation: o3tl::enumarray<ScContentId, std::__1::unique_ptr<weld::TreeIter, std::__1::default_delete<weld::TreeIter> > >::enumarray()
Unexecuted instantiation: o3tl::enumarray<ScContentId, unsigned short>::enumarray()
o3tl::enumarray<TSS_Type, PPTExtParaSheet>::enumarray()
Line
Count
Source
73
14.6k
    enumarray() {}
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<PPTCharSheet, std::__1::default_delete<PPTCharSheet> > >::enumarray()
Line
Count
Source
73
14.6k
    enumarray() {}
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<PPTParaSheet, std::__1::default_delete<PPTParaSheet> > >::enumarray()
Line
Count
Source
73
14.6k
    enumarray() {}
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<SvxNumBulletItem, std::__1::default_delete<SvxNumBulletItem> > >::enumarray()
Line
Count
Source
73
14.6k
    enumarray() {}
o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > >::enumarray()
Line
Count
Source
73
26
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<LockFileComponent, rtl::OUString>::enumarray()
o3tl::enumarray<XPropertyListType, rtl::Reference<XPropertyList> >::enumarray()
Line
Count
Source
73
162k
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, bool>::enumarray()
Unexecuted instantiation: o3tl::enumarray<SvxBoxInfoItemLine, bool>::enumarray()
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, unsigned short>::enumarray()
o3tl::enumarray<GlobalEventId, rtl::OUString>::enumarray()
Line
Count
Source
73
6
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> >::enumarray()
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > >::enumarray()
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, bool>::enumarray()
o3tl::enumarray<SwFontScript, void const*>::enumarray()
Line
Count
Source
73
491k
    enumarray() {}
o3tl::enumarray<SwFontScript, unsigned short>::enumarray()
Line
Count
Source
73
491k
    enumarray() {}
o3tl::enumarray<SwFontScript, SwSubFont>::enumarray()
Line
Count
Source
73
75.9k
    enumarray() {}
Unexecuted instantiation: o3tl::enumarray<ContentTypeId, std::__1::unique_ptr<SwContentType, std::__1::default_delete<SwContentType> > >::enumarray()
Unexecuted instantiation: o3tl::enumarray<ContentTypeId, bool>::enumarray()
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, bool>::enumarray()
Line
Count
Source
73
5.33k
    enumarray() {}
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, com::sun::star::table::BorderLine2>::enumarray()
Line
Count
Source
73
5.33k
    enumarray() {}
o3tl::enumarray<PresObjKind, int>::enumarray()
Line
Count
Source
73
282k
    enumarray() {}
74
75
    const V& operator[](E index) const
76
51.8M
    {
77
51.8M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
51.8M
        return detail_values[static_cast<size_type>(index)];
79
51.8M
    }
Unexecuted instantiation: o3tl::enumarray<SalBitmap::BitConvert, int>::operator[](SalBitmap::BitConvert) const
o3tl::enumarray<INetProtocol, INetURLObject::SchemeInfo>::operator[](INetProtocol) const
Line
Count
Source
76
11.1M
    {
77
11.1M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
11.1M
        return detail_values[static_cast<size_type>(index)];
79
11.1M
    }
moduleoptions.cxx:o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>::operator[](SvtModuleOptions::EFactory) const
Line
Count
Source
76
8.97k
    {
77
8.97k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
8.97k
        return detail_values[static_cast<size_type>(index)];
79
8.97k
    }
Unexecuted instantiation: o3tl::enumarray<UserOptToken, rtl::OUString>::operator[](UserOptToken) const
o3tl::enumarray<XPropertyListType, rtl::Reference<XPropertyList> >::operator[](XPropertyListType) const
Line
Count
Source
76
1.98M
    {
77
1.98M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
1.98M
        return detail_values[static_cast<size_type>(index)];
79
1.98M
    }
o3tl::enumarray<oox::xls::Unit, double>::operator[](oox::xls::Unit) const
Line
Count
Source
76
310k
    {
77
310k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
310k
        return detail_values[static_cast<size_type>(index)];
79
310k
    }
o3tl::enumarray<oox::drawingml::ShapeProperty, int>::operator[](oox::drawingml::ShapeProperty) const
Line
Count
Source
76
427k
    {
77
427k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
427k
        return detail_values[static_cast<size_type>(index)];
79
427k
    }
Unexecuted instantiation: o3tl::enumarray<ScContentId, bool>::operator[](ScContentId) const
Unexecuted instantiation: o3tl::enumarray<ScContentId, std::__1::unique_ptr<weld::TreeIter, std::__1::default_delete<weld::TreeIter> > >::operator[](ScContentId) const
o3tl::enumarray<SvxAdjust, short>::operator[](SvxAdjust) const
Line
Count
Source
76
14.2k
    {
77
14.2k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
14.2k
        return detail_values[static_cast<size_type>(index)];
79
14.2k
    }
o3tl::enumarray<TSS_Type, PPTExtParaSheet>::operator[](TSS_Type) const
Line
Count
Source
76
15.3k
    {
77
15.3k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
15.3k
        return detail_values[static_cast<size_type>(index)];
79
15.3k
    }
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<PPTCharSheet, std::__1::default_delete<PPTCharSheet> > >::operator[](TSS_Type) const
Line
Count
Source
76
6.79M
    {
77
6.79M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
6.79M
        return detail_values[static_cast<size_type>(index)];
79
6.79M
    }
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<PPTParaSheet, std::__1::default_delete<PPTParaSheet> > >::operator[](TSS_Type) const
Line
Count
Source
76
7.88M
    {
77
7.88M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
7.88M
        return detail_values[static_cast<size_type>(index)];
79
7.88M
    }
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<SvxNumBulletItem, std::__1::default_delete<SvxNumBulletItem> > >::operator[](TSS_Type) const
Line
Count
Source
76
242k
    {
77
242k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
242k
        return detail_values[static_cast<size_type>(index)];
79
242k
    }
o3tl::enumarray<GlobalEventId, rtl::OUString>::operator[](GlobalEventId) const
Line
Count
Source
76
168
    {
77
168
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
168
        return detail_values[static_cast<size_type>(index)];
79
168
    }
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, Size>::operator[](vcl::ImageType) const
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, rtl::OUString>::operator[](vcl::ImageType) const
o3tl::enumarray<SwFontScript, SwSubFont>::operator[](SwFontScript) const
Line
Count
Source
76
20.9M
    {
77
20.9M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
20.9M
        return detail_values[static_cast<size_type>(index)];
79
20.9M
    }
o3tl::enumarray<SwFieldIds, SwFieldTypesEnum>::operator[](SwFieldIds) const
Line
Count
Source
76
114k
    {
77
114k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
114k
        return detail_values[static_cast<size_type>(index)];
79
114k
    }
Unexecuted instantiation: o3tl::enumarray<SwFontScript, long>::operator[](SwFontScript) const
Unexecuted instantiation: o3tl::enumarray<ContentTypeId, std::__1::unique_ptr<SwContentType, std::__1::default_delete<SwContentType> > >::operator[](ContentTypeId) const
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, writerfilter::dmapper::PropertyIds>::operator[](writerfilter::dmapper::BorderHandler::BorderPosition) const
Line
Count
Source
76
9.37k
    {
77
9.37k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
9.37k
        return detail_values[static_cast<size_type>(index)];
79
9.37k
    }
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, unsigned short>::operator[](SvxBoxItemLine) const
o3tl::enumarray<PresObjKind, char const*>::operator[](PresObjKind) const
Line
Count
Source
76
545k
    {
77
545k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
545k
        return detail_values[static_cast<size_type>(index)];
79
545k
    }
o3tl::enumarray<PageKind, char const*>::operator[](PageKind) const
Line
Count
Source
76
1.37M
    {
77
1.37M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
78
1.37M
        return detail_values[static_cast<size_type>(index)];
79
1.37M
    }
80
81
    V& operator[](E index)
82
146M
    {
83
146M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
146M
        return detail_values[static_cast<size_type>(index)];
85
146M
    }
Unexecuted instantiation: o3tl::enumarray<VclPackType, std::__1::vector<vcl::Window*, std::__1::allocator<vcl::Window*> > >::operator[](VclPackType)
Unexecuted instantiation: o3tl::enumarray<MetaActionType, bool>::operator[](MetaActionType)
Unexecuted instantiation: o3tl::enumarray<SvImpLBox::ImageType, Image>::operator[](SvImpLBox::ImageType)
o3tl::enumarray<vcl::EnumContext::Application, rtl::OUString>::operator[](vcl::EnumContext::Application)
Line
Count
Source
82
28
    {
83
28
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
28
        return detail_values[static_cast<size_type>(index)];
85
28
    }
o3tl::enumarray<vcl::EnumContext::Context, rtl::OUString>::operator[](vcl::EnumContext::Context)
Line
Count
Source
82
17.0k
    {
83
17.0k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
17.0k
        return detail_values[static_cast<size_type>(index)];
85
17.0k
    }
Unexecuted instantiation: o3tl::enumarray<SvtPathOptions::Paths, rtl::OUString>::operator[](SvtPathOptions::Paths)
moduleoptions.cxx:o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>::operator[](SvtModuleOptions::EFactory)
Line
Count
Source
82
110
    {
83
110
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
110
        return detail_values[static_cast<size_type>(index)];
85
110
    }
o3tl::enumarray<XPropertyListType, rtl::Reference<XPropertyList> >::operator[](XPropertyListType)
Line
Count
Source
82
1.15M
    {
83
1.15M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
1.15M
        return detail_values[static_cast<size_type>(index)];
85
1.15M
    }
o3tl::enumarray<oox::xls::Unit, double>::operator[](oox::xls::Unit)
Line
Count
Source
82
34.6k
    {
83
34.6k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
34.6k
        return detail_values[static_cast<size_type>(index)];
85
34.6k
    }
Unexecuted instantiation: o3tl::enumarray<ScContentId, bool>::operator[](ScContentId)
Unexecuted instantiation: o3tl::enumarray<sc::DebugTime, double>::operator[](sc::DebugTime)
Unexecuted instantiation: o3tl::enumarray<ScContentId, unsigned short>::operator[](ScContentId)
Unexecuted instantiation: o3tl::enumarray<ScContentId, std::__1::unique_ptr<weld::TreeIter, std::__1::default_delete<weld::TreeIter> > >::operator[](ScContentId)
o3tl::enumarray<TSS_Type, PPTExtParaSheet>::operator[](TSS_Type)
Line
Count
Source
82
3.23k
    {
83
3.23k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
3.23k
        return detail_values[static_cast<size_type>(index)];
85
3.23k
    }
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<PPTCharSheet, std::__1::default_delete<PPTCharSheet> > >::operator[](TSS_Type)
Line
Count
Source
82
1.69M
    {
83
1.69M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
1.69M
        return detail_values[static_cast<size_type>(index)];
85
1.69M
    }
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<PPTParaSheet, std::__1::default_delete<PPTParaSheet> > >::operator[](TSS_Type)
Line
Count
Source
82
1.64M
    {
83
1.64M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
1.64M
        return detail_values[static_cast<size_type>(index)];
85
1.64M
    }
o3tl::enumarray<TSS_Type, std::__1::unique_ptr<SvxNumBulletItem, std::__1::default_delete<SvxNumBulletItem> > >::operator[](TSS_Type)
Line
Count
Source
82
263k
    {
83
263k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
263k
        return detail_values[static_cast<size_type>(index)];
85
263k
    }
o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > >::operator[](SfxToolsModule)
Line
Count
Source
82
59.5M
    {
83
59.5M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
59.5M
        return detail_values[static_cast<size_type>(index)];
85
59.5M
    }
Unexecuted instantiation: o3tl::enumarray<LockFileComponent, rtl::OUString>::operator[](LockFileComponent)
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, bool>::operator[](SvxBoxItemLine)
Unexecuted instantiation: o3tl::enumarray<SvxBoxInfoItemLine, bool>::operator[](SvxBoxInfoItemLine)
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, unsigned short>::operator[](SvxBoxItemLine)
o3tl::enumarray<GlobalEventId, rtl::OUString>::operator[](GlobalEventId)
Line
Count
Source
82
168
    {
83
168
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
168
        return detail_values[static_cast<size_type>(index)];
85
168
    }
o3tl::enumarray<oox::drawingml::ShapeProperty, int>::operator[](oox::drawingml::ShapeProperty)
Line
Count
Source
82
7.10k
    {
83
7.10k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
7.10k
        return detail_values[static_cast<size_type>(index)];
85
7.10k
    }
Unexecuted instantiation: o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> >::operator[](dbaccess::ODatabaseModelImpl::ObjectType)
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > >::operator[](vcl::ImageType)
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, bool>::operator[](vcl::ImageType)
o3tl::enumarray<SwFontScript, SwSubFont>::operator[](SwFontScript)
Line
Count
Source
82
59.3M
    {
83
59.3M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
59.3M
        return detail_values[static_cast<size_type>(index)];
85
59.3M
    }
o3tl::enumarray<SwFontScript, void const*>::operator[](SwFontScript)
Line
Count
Source
82
12.9M
    {
83
12.9M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
12.9M
        return detail_values[static_cast<size_type>(index)];
85
12.9M
    }
o3tl::enumarray<SwFontScript, unsigned short>::operator[](SwFontScript)
Line
Count
Source
82
8.81M
    {
83
8.81M
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
8.81M
        return detail_values[static_cast<size_type>(index)];
85
8.81M
    }
Unexecuted instantiation: o3tl::enumarray<SwFontScript, long>::operator[](SwFontScript)
Unexecuted instantiation: o3tl::enumarray<ContentTypeId, bool>::operator[](ContentTypeId)
Unexecuted instantiation: o3tl::enumarray<ContentTypeId, std::__1::unique_ptr<SwContentType, std::__1::default_delete<SwContentType> > >::operator[](ContentTypeId)
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, com::sun::star::table::BorderLine2>::operator[](writerfilter::dmapper::BorderHandler::BorderPosition)
Line
Count
Source
82
18.7k
    {
83
18.7k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
18.7k
        return detail_values[static_cast<size_type>(index)];
85
18.7k
    }
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, bool>::operator[](writerfilter::dmapper::BorderHandler::BorderPosition)
Line
Count
Source
82
25.9k
    {
83
25.9k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
25.9k
        return detail_values[static_cast<size_type>(index)];
85
25.9k
    }
o3tl::enumarray<PresObjKind, int>::operator[](PresObjKind)
Line
Count
Source
82
592k
    {
83
592k
        assert(index>=static_cast<E>(0) && index<=E::LAST);
84
592k
        return detail_values[static_cast<size_type>(index)];
85
592k
    }
86
87
    void fill(V val)
88
5.44M
    { for (size_type i=0; i<=max_index; ++i) detail_values[i] = val; }
Unexecuted instantiation: o3tl::enumarray<MetaActionType, bool>::fill(bool)
Unexecuted instantiation: o3tl::enumarray<ScContentId, bool>::fill(bool)
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, bool>::fill(bool)
Unexecuted instantiation: o3tl::enumarray<SvxBoxInfoItemLine, bool>::fill(bool)
Unexecuted instantiation: o3tl::enumarray<SvxBoxItemLine, unsigned short>::fill(unsigned short)
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, bool>::fill(bool)
Line
Count
Source
88
37.3k
    { for (size_type i=0; i<=max_index; ++i) detail_values[i] = val; }
o3tl::enumarray<writerfilter::dmapper::BorderHandler::BorderPosition, com::sun::star::table::BorderLine2>::fill(com::sun::star::table::BorderLine2)
Line
Count
Source
88
37.3k
    { for (size_type i=0; i<=max_index; ++i) detail_values[i] = val; }
o3tl::enumarray<PresObjKind, int>::fill(int)
Line
Count
Source
88
5.37M
    { for (size_type i=0; i<=max_index; ++i) detail_values[i] = val; }
89
90
13
    static size_type size()        { return max_index + 1; }
moduleoptions.cxx:o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>::size()
Line
Count
Source
90
10
    static size_type size()        { return max_index + 1; }
Unexecuted instantiation: o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > >::size()
o3tl::enumarray<GlobalEventId, rtl::OUString>::size()
Line
Count
Source
90
3
    static size_type size()        { return max_index + 1; }
Unexecuted instantiation: o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> >::size()
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > >::size()
91
10
    iterator         begin()       { return iterator(*this, 0); }
moduleoptions.cxx:o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>::begin()
Line
Count
Source
91
10
    iterator         begin()       { return iterator(*this, 0); }
Unexecuted instantiation: o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > >::begin()
Unexecuted instantiation: o3tl::enumarray<GlobalEventId, rtl::OUString>::begin()
Unexecuted instantiation: o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> >::begin()
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > >::begin()
92
10
    iterator         end()         { return iterator(*this, size()); }
moduleoptions.cxx:o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>::end()
Line
Count
Source
92
10
    iterator         end()         { return iterator(*this, size()); }
Unexecuted instantiation: o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > >::end()
Unexecuted instantiation: o3tl::enumarray<GlobalEventId, rtl::OUString>::end()
Unexecuted instantiation: o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> >::end()
Unexecuted instantiation: o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > >::end()
93
    const_iterator   begin() const { return const_iterator(*this, 0); }
94
    const_iterator   end() const   { return const_iterator(*this, size()); }
95
96
3
    V*               data()       { return detail_values.data(); }
97
98
private:
99
    std::array<V, max_index + 1> detail_values;
100
};
101
102
103
template<typename EA>
104
class enumarray_iterator {
105
    EA*         m_buf;
106
    size_t      m_pos;
107
public:
108
    typedef enumarray_iterator<EA>  self_type;
109
    typedef typename EA::value_type value_type;
110
    typedef typename EA::key_type   key_type;
111
    typedef std::bidirectional_iterator_tag iterator_category; //should be random access, but that would require define subtraction operators on the enums
112
    typedef
113
        typename std::make_signed<
114
            typename std::underlying_type<typename EA::key_type>::type>::type
115
        difference_type;
116
    typedef typename EA::value_type*   pointer;
117
    typedef typename EA::value_type&   reference;
118
119
    enumarray_iterator(EA& b, size_t start_pos)
120
20
         : m_buf(&b), m_pos(start_pos) {}
moduleoptions.cxx:o3tl::enumarray_iterator<o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo> >::enumarray_iterator(o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo>&, unsigned long)
Line
Count
Source
120
20
         : m_buf(&b), m_pos(start_pos) {}
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > > >::enumarray_iterator(o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > >&, unsigned long)
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<GlobalEventId, rtl::OUString> >::enumarray_iterator(o3tl::enumarray<GlobalEventId, rtl::OUString>&, unsigned long)
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> > >::enumarray_iterator(o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> >&, unsigned long)
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > > >::enumarray_iterator(o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > >&, unsigned long)
121
110
    value_type& operator*()  const { return (*m_buf)[static_cast<key_type>(m_pos)]; }
moduleoptions.cxx:o3tl::enumarray_iterator<o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo> >::operator*() const
Line
Count
Source
121
110
    value_type& operator*()  const { return (*m_buf)[static_cast<key_type>(m_pos)]; }
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > > >::operator*() const
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<GlobalEventId, rtl::OUString> >::operator*() const
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> > >::operator*() const
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > > >::operator*() const
122
    value_type* operator->() const { return &(operator*()); }
123
110
    self_type&  operator++() { ++m_pos; return *this; }
moduleoptions.cxx:o3tl::enumarray_iterator<o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo> >::operator++()
Line
Count
Source
123
110
    self_type&  operator++() { ++m_pos; return *this; }
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > > >::operator++()
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<GlobalEventId, rtl::OUString> >::operator++()
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> > >::operator++()
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > > >::operator++()
124
120
    bool        operator!=(self_type const & other) const { return m_buf != other.m_buf || m_pos != other.m_pos; }
moduleoptions.cxx:o3tl::enumarray_iterator<o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo> >::operator!=(o3tl::enumarray_iterator<o3tl::enumarray<SvtModuleOptions::EFactory, (anonymous namespace)::FactoryInfo> > const&) const
Line
Count
Source
124
120
    bool        operator!=(self_type const & other) const { return m_buf != other.m_buf || m_pos != other.m_pos; }
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > > >::operator!=(o3tl::enumarray_iterator<o3tl::enumarray<SfxToolsModule, std::__1::unique_ptr<SfxModule, std::__1::default_delete<SfxModule> > > > const&) const
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<GlobalEventId, rtl::OUString> >::operator!=(o3tl::enumarray_iterator<o3tl::enumarray<GlobalEventId, rtl::OUString> > const&) const
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> > >::operator!=(o3tl::enumarray_iterator<o3tl::enumarray<dbaccess::ODatabaseModelImpl::ObjectType, std::__1::shared_ptr<dbaccess::OContentHelper_Impl> > > const&) const
Unexecuted instantiation: o3tl::enumarray_iterator<o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > > >::operator!=(o3tl::enumarray_iterator<o3tl::enumarray<vcl::ImageType, std::__1::unique_ptr<ImageList, std::__1::default_delete<ImageList> > > > const&) const
125
0
    bool        operator==(self_type const & other) const { return m_buf == other.m_buf && m_pos == other.m_pos; }
126
};
127
128
template<typename EA>
129
class enumarray_const_iterator {
130
    EA const *  m_buf;
131
    size_t      m_pos;
132
public:
133
    typedef enumarray_const_iterator<EA>    self_type;
134
    typedef typename EA::value_type const   value_type;
135
    typedef typename EA::key_type           key_type;
136
    typedef std::bidirectional_iterator_tag iterator_category; //should be random access, but that would require define subtraction operators on the enums
137
    typedef
138
        typename std::make_signed<
139
            typename std::underlying_type<typename EA::key_type>::type>::type
140
                                            difference_type;
141
    typedef typename EA::value_type const * pointer;
142
    typedef typename EA::value_type const & reference;
143
144
    enumarray_const_iterator(EA const & b, size_t start_pos)
145
         : m_buf(&b), m_pos(start_pos) {}
146
    value_type& operator*()  const { return (*m_buf)[static_cast<key_type>(m_pos)]; }
147
    value_type* operator->() const { return &(operator*()); }
148
    self_type&  operator++() { ++m_pos; return *this; }
149
    bool        operator!=(self_type const & other) const { return m_buf != other.m_buf || m_pos != other.m_pos; }
150
    bool        operator==(self_type const & other) const { return m_buf == other.m_buf && m_pos == other.m_pos; }
151
};
152
153
}; // namespace o3tl
154
155
#endif /* INCLUDED_O3TL_ENUMARRAY_HXX */
156
157
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */