LibreOffice Module sc (master) 1
sharedformulagroups.hxx
Go to the documentation of this file.
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
10#pragma once
11
12#include <address.hxx>
13#include <tokenarray.hxx>
14#include <memory>
15#include <map>
16class ScTokenArray;
17
18namespace sc
19{
21{
22private:
23 std::unique_ptr<ScTokenArray> mpArray;
25
26public:
27 SharedFormulaGroupEntry(std::unique_ptr<ScTokenArray> pArray, const ScAddress& rOrigin)
28 : mpArray(std::move(pArray))
29 , maOrigin(rOrigin)
30 {
31 }
32
33 const ScTokenArray* getTokenArray() const { return mpArray.get(); }
34 const ScAddress& getOrigin() const { return maOrigin; }
35};
36
38{
39private:
40 typedef std::map<size_t, SharedFormulaGroupEntry> StoreType;
42
43public:
44 void set(size_t nSharedId, std::unique_ptr<ScTokenArray> pArray);
45 void set(size_t nSharedId, std::unique_ptr<ScTokenArray> pArray, const ScAddress& rOrigin);
46 const ScTokenArray* get(size_t nSharedId) const;
47 const SharedFormulaGroupEntry* getEntry(size_t nSharedId) const;
48};
49}
50
51/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const ScAddress & getOrigin() const
const ScTokenArray * getTokenArray() const
SharedFormulaGroupEntry(std::unique_ptr< ScTokenArray > pArray, const ScAddress &rOrigin)
std::unique_ptr< ScTokenArray > mpArray
void set(size_t nSharedId, std::unique_ptr< ScTokenArray > pArray)
const ScTokenArray * get(size_t nSharedId) const
std::map< size_t, SharedFormulaGroupEntry > StoreType
const SharedFormulaGroupEntry * getEntry(size_t nSharedId) const
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15