long-term maintenance improvement for runTime selection tables
Files
4- Mark OLESEN authored
- this makes the lookup and use of tables slightly cleaner and provides a hook for update (compat) messages The singleton-style method returns the function pointer directly, or nullptr on not-found. NEW access method (mnemonic: 'ctor' prefix for constructors) ``` auto* ctorPtr = dictionaryConstructorTable(modelType); if (!ctorPtr) { ... } return autoPtr<myModel>(ctorPtr(dict, ...)); ``` OLD method, which also still works, but without any compat handling: ``` auto ctorIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!ctorIter.found()) { ... } return autoPtr<myModel>(ctorIter()(dict, ...)); ```
@@ -76,6 +76,16 @@ Note
@@ -99,6 +109,16 @@ Note
@@ -122,6 +142,17 @@ Note