summaryrefslogtreecommitdiffstats
path: root/include/ixion/named_expressions_iterator.hpp
blob: 7511fef3e87e90614ee5a4ab547f63e65fb63ab0 (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
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * 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 INCLUDED_IXION_NAMED_EXPRESSIONS_ITERATOR_HPP
#define INCLUDED_IXION_NAMED_EXPRESSIONS_ITERATOR_HPP

#include "types.hpp"
#include "formula_tokens_fwd.hpp"

#include <memory>
#include <iosfwd>
#include <string>

namespace ixion {

class model_context;
struct abs_address_t;

class IXION_DLLPUBLIC named_expressions_iterator
{
    friend class model_context;

    struct impl;
    std::unique_ptr<impl> mp_impl;

    named_expressions_iterator(const model_context& cxt, sheet_t scope);

public:
    named_expressions_iterator();
    named_expressions_iterator(const named_expressions_iterator& other);
    named_expressions_iterator(named_expressions_iterator&& other);
    ~named_expressions_iterator();

    struct named_expression
    {
        const std::string* name;
        const named_expression_t* expression;
    };

    size_t size() const;
    bool has() const;
    void next();

    named_expression get() const;

    named_expressions_iterator& operator= (const named_expressions_iterator& other);
};

}

#endif

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