DgnComponentHandlers.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
10 
11 DGNPLATFORM_TYPEDEFS (ParametricCellRemapTable);
12 
14 
17 
18 /*=================================================================================**/
25  {
26 private:
27  virtual void MakeClassAbstract() = 0;
28 public:
29 public:
32  DGNPLATFORM_EXPORT IParameterDefinitionsPtr GetParameterDefinitions() const;
34  DGNPLATFORM_EXPORT IParameterSetCollectionPtr GetParameterSets() const;
37  DGNPLATFORM_EXPORT IDgnComponentDefinitionModelHandlerCP GetDefinitionModelHandler() const;
38  };
39 
40 /*---------------------------------------------------------------------------------**/
50  {
51 private:
52  typedef bmap<WString, WString> RemapTable;
53 
54  RemapTable m_variations;
55  RemapTable m_variables;
56 
57  static WCharCP GetRemappedValue (WCharCP toRemap, RemapTable const& table);
58  static bool SetRemappedValue (WCharCP remapFrom, WCharCP remapTo, RemapTable& table);
59 public:
63  DGNPLATFORM_EXPORT WCharCP ResolveParameterSet (WCharCP oldParameterSetName) const;
67  DGNPLATFORM_EXPORT WCharCP ResolveVariable (WCharCP oldVariableAccessString) const;
68 
70  DGNPLATFORM_EXPORT bool RemapParameterSet (WCharCP remapFrom, WCharCP remapTo);
72  DGNPLATFORM_EXPORT bool RemapVariable (WCharCP remapFromAccessString, WCharCP remapToAccessString);
73 
76 
77  typedef RemapTable::const_iterator VariableIterator;
78  VariableIterator begin() const { return m_variables.begin(); }
79  VariableIterator end() const { return m_variables.end(); }
80 
81  typedef RemapTable::const_iterator ParameterSetIterator;
82  ParameterSetIterator BeginParameterSets() const { return m_variations.begin(); }
83  ParameterSetIterator EndParameterSets() const { return m_variations.end(); }
84  };
85 
86 /*---------------------------------------------------------------------------------**/
91  {
92  Success = SUCCESS,
93  SchemasDiffer = 1,
94  ReadOnly,
95  CellNotFound,
96 
97  Error = ERROR,
98  };
99 
100 /*---------------------------------------------------------------------------------**/
109  {
110 private:
111  virtual void MakeClassAbstract() = 0;
112 public:
113 public:
120  DGNPLATFORM_EXPORT ParameterStatus CreateParameterSet (IParameterSetPtr& parameterSet, WCharCP name, WCharCP description, IParameterValuesCR values) const;
121 
125  DGNPLATFORM_EXPORT ParameterStatus DeleteParameterSet (IParameterSetR parameterSet) const;
126 
130  DGNPLATFORM_EXPORT ParameterStatus CreateCellDefinition (DgnFileR targetFile) const;
131 
136  DGNPLATFORM_EXPORT UpdateParametricCellDefStatus UpdateCellDefinition (DgnFileR targetFile, ParametricCellRemapTableCR remapTable) const;
137 
141  DGNPLATFORM_EXPORT void InitializeRemapTable (ParametricCellRemapTableR remapTable, ParametricCellDefinitionCR cellDef) const;
142  };
ECSchema referenced by updated cell definition differs from that stored in the active file...
Handler responsible for managing a DgnModel which can serve as a "definition model" for parametric mo...
Definition: DgnComponentHandlers.h:108
Definition: Bentley.h:212
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
struct DgnPlatform::IDgnComponentDefinitionModelHandler const * IDgnComponentDefinitionModelHandlerCP
Definition: DgnPlatform.h:288
RemapTable::const_iterator VariableIterator
Definition: DgnComponentHandlers.h:77
ParameterStatus
Return status codes for Parametric Modeling-related functions.
Definition: ParametricModeling.h:82
UpdateParametricCellDefStatus
Return status codes produced when updating a parametric cell definition.
Definition: DgnComponentHandlers.h:90
ParameterSetIterator BeginParameterSets() const
Definition: DgnComponentHandlers.h:82
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
wchar_t const * WCharCP
Definition: Bentley.h:224
DGNPLATFORM_TYPEDEFS(ParametricCellRemapTable)
VariableIterator end() const
Definition: DgnComponentHandlers.h:79
A DgnComponentDefinitionHandler is associated with a DgnModel to provide access to parameters and par...
Definition: DgnComponentHandlers.h:24
Specifies how to remap parametric cell instances when updating a parametric cell definition.
Definition: DgnComponentHandlers.h:49
VariableIterator begin() const
Definition: DgnComponentHandlers.h:78
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Definition: Bentley.h:210
RemapTable::const_iterator ParameterSetIterator
Definition: DgnComponentHandlers.h:81
virtual ~IDgnComponentDefinitionHandler()
Definition: DgnComponentHandlers.h:30
ParameterSetIterator EndParameterSets() const
Definition: DgnComponentHandlers.h:83

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.