Topologic  0.8.9
AttributeFactoryManager.h
1 // This file is part of Topologic software library.
2 // Copyright(C) 2019, Cardiff University and University College London
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
13 //
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16 
17 #pragma once
18 
19 using namespace System;
20 using namespace System::Collections::Generic;
21 
22 namespace TopologicCore
23 {
24  class Attribute;
25 }
26 
27 namespace Topologic
28 {
29  ref class Topology;
30 
31  namespace Attributes
32  {
33  ref class AttributeFactory;
34 
38  ref class AttributeFactoryManager
39  {
40  public protected:
41  static property AttributeFactoryManager^ Instance {
42  AttributeFactoryManager^ get() { return %m_instance; }
43  }
44 
45  void SetAttribute(Topology^ topology, String^ key, Object^ value);
46 
47  AttributeFactory^ GetFactory(const std::shared_ptr<TopologicCore::Attribute> kpUtilitiesAttribute);
48 
49  AttributeFactory^ GetFactory(Object^ value);
50 
51  private:
52  AttributeFactoryManager();
53  AttributeFactoryManager(const AttributeFactoryManager%) { throw gcnew System::InvalidOperationException("Singleton cannot be copy-constructed"); }
54 
55  static AttributeFactoryManager m_instance;
56  Dictionary<String^, AttributeFactory^>^ m_attributeFactoryDict = gcnew Dictionary<String^, AttributeFactory^>();
57  };
58  }
59 }
Definition: AttributeFactoryManager.h:22
Topologic is an open-source software modelling library enabling hierarchical and topological represen...
Definition: About.h:23