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>
16 class ScTokenArray;
17 
18 namespace sc
19 {
21 {
22 private:
23  std::unique_ptr<ScTokenArray> mpArray;
25 
26 public:
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 {
39 private:
40  typedef std::map<size_t, SharedFormulaGroupEntry> StoreType;
41  StoreType m_Store;
42 
43 public:
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: */
SharedFormulaGroupEntry(std::unique_ptr< ScTokenArray > pArray, const ScAddress &rOrigin)
const ScAddress & getOrigin() const
const ScTokenArray * getTokenArray() const
std::map< size_t, SharedFormulaGroupEntry > StoreType
const SharedFormulaGroupEntry * getEntry(size_t nSharedId) const
std::unique_ptr< ScTokenArray > mpArray
void set(size_t nSharedId, std::unique_ptr< ScTokenArray > pArray)