summaryrefslogtreecommitdiff
path: root/include/formula/vectortoken.hxx
blob: 2679b4ef0e0627d2659b85e1a4d394a26f069a5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef FORMULA_VECTORTOKEN_HXX
#define FORMULA_VECTORTOKEN_HXX

#include "formula/token.hxx"

namespace formula {

class FORMULA_DLLPUBLIC SingleVectorRefToken : public FormulaToken
{
    const double* mpArray;
    size_t mnArrayLength;

public:
    SingleVectorRefToken( const double* pArray, size_t nLength );

    virtual FormulaToken* Clone() const;

    const double* GetArray() const;
    size_t GetArrayLength() const;
};

/**
 * This token describes a range reference in a vectorized formula
 * calculation context.
 */
class FORMULA_DLLPUBLIC DoubleVectorRefToken : public FormulaToken
{
    std::vector<const double*> maArrays;

    size_t mnArrayLength;
    size_t mnRefRowSize;

    bool mbStartFixed:1; /// whether or not the start row position is absolute.
    bool mbEndFixed:1; /// whether or not the end row position is absolute.

public:
    DoubleVectorRefToken(
        const std::vector<const double*>& rArrays, size_t nArrayLength, size_t nRefRowSize, bool bStartFixed, bool bEndFixed );

    virtual FormulaToken* Clone() const;

    const std::vector<const double*>& GetArrays() const;
    size_t GetArrayLength() const;
    size_t GetRefRowSize() const;
    bool IsStartFixed() const;
    bool IsEndFixed() const;
};

}

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */