Changes in src/UIElements/Dialog.hpp [37a67f:163110]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Dialog.hpp
r37a67f r163110 22 22 #include "LinearAlgebra/RealSpaceMatrix.hpp" 23 23 #include "LinearAlgebra/Vector.hpp" 24 #include "RandomNumbers/RandomNumberDistribution_Parameters.hpp" 24 25 #include "Parameters/Parameter.hpp" 25 #include "Parameters/Specifics/KeyValuePair.hpp"26 26 27 27 class atom; … … 29 29 class element; 30 30 class molecule; 31 31 32 32 33 /** Dialog is one of the two main classes of the UIFactory base class. … … 132 133 * Due to the three present UI interfaces we have to add a specific Query for each, here 133 134 * is a list: 134 * -# add a token (i.e. a unique name for the query parameter) and its type to the 135 * global list in \ref GlobalListOfParameterQueries.hpp. This will via boost 136 * preprocessor magic add definitions and some intermediatr template specializations. 137 * -# add a specialization for each of the UI interfaces of Dialog::...Query class. 138 * -# add class declaration of QtDialog::...Query in \ref QtQuery.hpp 135 * -# add ValueStorage::setCurrentValue() and ValueStorage::queryCurrentValue() for 136 * both types 137 * -# add Dialog::query...() 138 * -# add Dialog::query<>() specialization calling the above function 139 * -# add CommandLineDialog::query...(), TextDialog::query...(), and QtDialog::query...(), 140 * i.e. for each of the three interface 141 * -# add empty definition DummyDialog::query...() to the stub for Action unittests in DummUI.hpp. 142 * -# add Dialog::...Query class with tmp value of desired type 139 143 * -# add CommandLineDialog::...Query, TextDialog::...Query, QtDialog::...Query 140 * -# TypeEnumContainer add new type to query. Make the Type name match with the token 144 * -# you probably also need a QtDialog::...QueryPipe() to handle the signal/slot stuff, 145 * Qt's moc does not like nested classes. Hence, this has to go extra. 146 * -# TypeEnumContainer add new type to query 141 147 * -# CommandLineParser::AddOptionToParser() add new type to query 142 148 * -# CommandLineParser_valdiates.[ch]pp: If given above as a new type 143 149 * program_options::value, define and implement a validate() function here. 144 *145 * Note that the Empty..Query is always specificly present as it has not type and thus146 * does not fit into the preprocessor magic scheme (on the plus side it also serves147 * as a kind of visualization of what the preprocessor actually does).148 150 * 149 151 */ … … 157 159 158 160 virtual void queryEmpty(const std::string ="", const std::string = "")=0; 159 160 /** With the following boost::preprocessor code we generate virtual function 161 * definitions for all desired query types in the abstract class Dialog. 162 */ 163 #include "UIElements/GlobalListOfParameterQueries.hpp" 164 #include "UIElements/Dialog_impl_pre.hpp" 165 166 // iterate over all parameter query types 167 #if defined GLOBALLISTOFPARAMETERQUERIES_Token && defined GLOBALLISTOFPARAMETERQUERIES_Type 168 #define SUFFIX =0 169 #define BOOST_PP_LOCAL_MACRO(n) dialog_declaration(~, n, GLOBALLISTOFPARAMETERQUERIES_Token, GLOBALLISTOFPARAMETERQUERIES_Type) 170 #define BOOST_PP_LOCAL_LIMITS (0, MAXPARAMETERTOKENS-1) 171 #include BOOST_PP_LOCAL_ITERATE() 172 #undef dialog_declaration 173 #undef SUFFIX 174 #endif 175 176 #include "Dialog_impl_undef.hpp" 177 /* End of preprocessor code piece */ 161 virtual void queryBoolean(Parameter<bool> &, const std::string ="", const std::string = "")=0; 162 virtual void queryInt(Parameter<int> &, const std::string ="", const std::string = "")=0; 163 virtual void queryInts(Parameter<std::vector<int> > &, const std::string ="", const std::string = "")=0; 164 virtual void queryUnsignedInt(Parameter<unsigned int> &, const std::string ="", const std::string = "")=0; 165 virtual void queryUnsignedInts(Parameter<std::vector<unsigned int> > &, const std::string ="", const std::string = "")=0; 166 virtual void queryDouble(Parameter<double> &, const std::string ="", const std::string = "")=0; 167 virtual void queryDoubles(Parameter<std::vector<double> > &, const std::string ="", const std::string = "")=0; 168 virtual void queryString(Parameter<std::string> &, const std::string ="", const std::string = "")=0; 169 virtual void queryStrings(Parameter<std::vector<std::string> > &, const std::string ="", const std::string = "")=0; 170 virtual void queryAtom(Parameter<const atom *> &, const std::string = "", const std::string = "")=0; 171 virtual void queryAtoms(Parameter<std::vector<const atom *> > &, const std::string = "", const std::string = "")=0; 172 virtual void queryMolecule(Parameter<const molecule *> &, const std::string ="", const std::string = "")=0; 173 virtual void queryMolecules(Parameter<std::vector<const molecule *> > &, const std::string ="", const std::string = "")=0; 174 virtual void queryVector(Parameter<Vector> &, const std::string ="", const std::string = "")=0; 175 virtual void queryVectors(Parameter<std::vector<Vector> > &, const std::string ="", const std::string = "")=0; 176 virtual void queryRealSpaceMatrix(Parameter<RealSpaceMatrix> &, const std::string ="", const std::string = "")=0; 177 virtual void queryElement(Parameter<const element *> &, const std::string ="", const std::string = "")=0; 178 virtual void queryElements(Parameter<std::vector<const element *> > &, const std::string ="", const std::string = "")=0; 179 virtual void queryFile(Parameter<boost::filesystem::path> &, const std::string ="", const std::string = "")=0; 180 virtual void queryFiles(Parameter< std::vector<boost::filesystem::path> > &, const std::string ="", const std::string = "")=0; 181 virtual void queryRandomNumberDistribution_Parameters(Parameter<RandomNumberDistribution_Parameters> &, const std::string ="", const std::string = "")=0; 178 182 179 183 virtual bool display(); … … 282 286 }; 283 287 288 284 289 #endif /* DIALOG_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.