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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_SHAREDFORMULAGROUPS_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_INC_SHAREDFORMULAGROUPS_HXX
12 
13 #include <address.hxx>
14 #include <tokenarray.hxx>
15 #include <memory>
16 #include <map>
17 class ScTokenArray;
18 
19 namespace sc
20 {
22 {
23 private:
24  std::unique_ptr<ScTokenArray> mpArray;
26 
27 public:
28  SharedFormulaGroupEntry(std::unique_ptr<ScTokenArray> pArray, const ScAddress& rOrigin)
29  : mpArray(std::move(pArray))
30  , maOrigin(rOrigin)
31  {
32  }
33 
34  const ScTokenArray* getTokenArray() const { return mpArray.get(); }
35  const ScAddress& getOrigin() const { return maOrigin; }
36 };
37 
39 {
40 private:
41  typedef std::map<size_t, SharedFormulaGroupEntry> StoreType;
42  StoreType m_Store;
43 
44 public:
45  void set(size_t nSharedId, std::unique_ptr<ScTokenArray> pArray);
46  void set(size_t nSharedId, std::unique_ptr<ScTokenArray> pArray, const ScAddress& rOrigin);
47  const ScTokenArray* get(size_t nSharedId) const;
48  const SharedFormulaGroupEntry* getEntry(size_t nSharedId) const;
49 };
50 }
51 
52 #endif
53 
54 /* 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)