source: src/UIElements/CommandLineUI/Query/CommandLineQuery.hpp@ 8c5e2a

Candidate_v1.6.1 ChemicalSpaceEvaluator Gui_displays_atomic_force_velocity PythonUI_with_named_parameters TremoloParser_IncreasedPrecision
Last change on this file since 8c5e2a was f4b6bc9, checked in by Frederik Heber <frederik.heber@…>, 7 years ago

Query::handle() no longer returns bool but has internal result flag.

  • we use this flag conditionally in setResult(), i.e. if the handle() has failed, then we should not set its result which might overwrite a present default value in the parameter.
  • this fixes the problem with StepWorldTime which has a default value of 1 but which was overwritten with 0 because of the non-conditionally calling of setResult().
  • this required change of "output-types" default parameter to an empty vector. So far, we were just lucky that this actually worked.
  • also StoreSaturatedFragmentAction needed the same change as default values have to be consistent over the specific token.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 * CommandLineQuery.hpp
3 *
4 * Created on: Nov 8, 2010
5 * Author: heber
6 */
7
8#ifndef COMMANDLINEQUERY_HPP_
9#define COMMANDLINEQUERY_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16
17#include "CommandLineUI/CommandLineDialog.hpp"
18
19class CommandLineDialog::EmptyCommandLineQuery : public Dialog::EmptyQuery {
20public:
21 EmptyCommandLineQuery(const std::string &_title, const std::string &_description = "");
22 virtual ~EmptyCommandLineQuery();
23 virtual void handle();
24};
25
26class CommandLineDialog::VectorCommandLineQuery : public Dialog::TQuery<Vector> {
27public:
28 VectorCommandLineQuery(Parameter<Vector> &_param, const std::string &_title, const std::string &_description = "");
29 virtual ~VectorCommandLineQuery();
30 virtual void handle();
31};
32
33class CommandLineDialog::VectorsCommandLineQuery : public Dialog::TQuery< std::vector<Vector> > {
34public:
35 VectorsCommandLineQuery(Parameter< std::vector<Vector> > &_param, const std::string &_title, const std::string &_description = "");
36 virtual ~VectorsCommandLineQuery();
37 virtual void handle();
38};
39
40 /** With the following boost::preprocessor code we generate forward declarations
41 * of query class for all desired query types in the Qt specialization class of
42 * Dialog.
43 */
44#include "UIElements/GlobalListOfParameterQueries.hpp"
45#include "UIElements/Dialog_impl_pre.hpp"
46
47 #include <boost/preprocessor/facilities/empty.hpp>
48
49 // iterate over all parameter query types for forward declarations
50 #if defined GLOBALLISTOFPARAMETERQUERIES_Token && defined GLOBALLISTOFPARAMETERQUERIES_Type
51 #define BOOST_PP_LOCAL_MACRO(n) queryclass_definition(~, n, GLOBALLISTOFPARAMETERQUERIES_Token, GLOBALLISTOFPARAMETERQUERIES_Type, CommandLine)
52 #define BOOST_PP_LOCAL_LIMITS (0, MAXPARAMETERTOKENS-1)
53 #include BOOST_PP_LOCAL_ITERATE()
54 #undef queryclass_definition
55 #endif
56
57#include "Dialog_impl_undef.hpp"
58 /* End of preprocessor code piece */
59
60
61#endif /* COMMANDLINEQUERY_HPP_ */
Note: See TracBrowser for help on using the repository browser.