Changeset b4fa106 for src/Actions/Action_impl_header.hpp
- Timestamp:
- Aug 28, 2010, 12:57:50 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- e3e6e2
- Parents:
- 9ee38b
- git-author:
- Frederik Heber <heber@…> (08/26/10 13:23:21)
- git-committer:
- Frederik Heber <heber@…> (08/28/10 00:57:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action_impl_header.hpp
r9ee38b rb4fa106 23 23 #define ACTION BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Action)) 24 24 #define COMMAND BOOST_PP_CAT(CATEGORY, ACTIONNAME) 25 #define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State))26 25 #define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) 27 #define PARAMSDOT BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters))28 26 29 27 // check if no lists given 30 #ifndef types31 #define MAX NOTOKENS 028 #ifndef paramtypes 29 #define MAXPARAMTYPES 0 32 30 #else 33 #define MAX NOTOKENS BOOST_PP_SEQ_SIZE(types)31 #define MAXPARAMTYPES BOOST_PP_SEQ_SIZE(paramtypes) 34 32 #endif 35 33 … … 44 42 45 43 // calculate numbers and check whether all have same size 46 #ifdef tokens47 BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAX NOTOKENS, BOOST_PP_SEQ_SIZE(tokens)),\48 ERROR: There are not the same number of " tokens" and "types" in: __FILE__ \44 #ifdef paramtokens 45 BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXPARAMTYPES, BOOST_PP_SEQ_SIZE(paramtokens)),\ 46 ERROR: There are not the same number of "paramtokens" and "paramtypes" in: __FILE__ \ 49 47 ) 50 48 #endif 51 #ifdef references52 BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAX NOTOKENS, BOOST_PP_SEQ_SIZE(references)),\53 ERROR: There are not the same number of " tokens" and "references" in: __FILE__ \49 #ifdef paramreferences 50 BOOST_PP_ASSERT_MSG(BOOST_PP_EQUAL(MAXPARAMTYPES, BOOST_PP_SEQ_SIZE(paramreferences)),\ 51 ERROR: There are not the same number of "paramtokens" and "paramreferences" in: __FILE__ \ 54 52 ) 55 53 #endif 56 54 57 55 // print a list of type ref followed by a separator, i.e. "int i;" 58 #define type_print(z,n, separator) \59 BOOST_PP_SEQ_ELEM(n, types) \60 BOOST_PP_SEQ_ELEM(n, references)\56 #define type_print(z,n,TYPELIST, VARLIST, separator) \ 57 BOOST_PP_SEQ_ELEM(n, TYPELIST) \ 58 BOOST_PP_SEQ_ELEM(n, VARLIST)\ 61 59 separator 62 60 63 61 // print a list of type ref followed, i.e. "int i, double position" 64 #define type_list(z,n, unused) \62 #define type_list(z,n,TYPELIST, VARLIST) \ 65 63 BOOST_PP_COMMA_IF(n)\ 66 BOOST_PP_SEQ_ELEM(n, types) \67 BOOST_PP_SEQ_ELEM(n, references)64 BOOST_PP_SEQ_ELEM(n, TYPELIST) \ 65 BOOST_PP_SEQ_ELEM(n, VARLIST) 68 66 69 // prints dialog->query calls for types with tokens 70 #define dialog_print(z,n,unused) \ 71 dialog->query<\ 72 BOOST_PP_SEQ_ELEM(n, types)\ 73 >(\ 74 BOOST_PP_SEQ_ELEM(n, tokens)\ 75 , ValueStorage::getInstance().getDescription(\ 76 BOOST_PP_SEQ_ELEM(n, tokens)\ 77 )); 78 79 // prints set/queryCurrentValue (command) for references and tokens 80 #define value_print(z,n,command) \ 81 ValueStorage::getInstance(). command (\ 82 BOOST_PP_SEQ_ELEM(n, tokens)\ 83 , \ 84 params.\ 85 BOOST_PP_SEQ_ELEM(n, references)\ 86 ); 87 88 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0) 89 #define COMMANDFULL \ 90 void COMMAND( \ 91 BOOST_PP_REPEAT(MAXNOTOKENS, type_list, ~) \ 92 ) 67 #if defined paramtypes && defined paramreferences 68 void COMMAND( 69 #define BOOST_PP_LOCAL_MACRO(n) type_list(~, n, paramtypes, paramreferences) 70 #define BOOST_PP_LOCAL_LIMITS (0, MAXPARAMTYPES-1) 71 #include BOOST_PP_LOCAL_ITERATE() 72 ); 93 73 # else 94 #define COMMANDFULL void COMMAND() 74 void COMMAND(); 95 75 #endif 96 76 97 COMMANDFULL; 77 class ACTION : public Action { 78 friend 79 #if defined paramtypes && defined paramreferences 80 void COMMAND( 81 #define BOOST_PP_LOCAL_MACRO(n) type_list(~, n, paramtypes, paramreferences) 82 #define BOOST_PP_LOCAL_LIMITS (0, MAXPARAMTYPES-1) 83 #include BOOST_PP_LOCAL_ITERATE() 84 ); 85 # else 86 void COMMAND(); 87 #endif 98 88 99 class ACTION : public Action {100 friend COMMANDFULL;101 89 public: 102 90 ACTION(); … … 109 97 110 98 struct PARAMS : ActionParameters { 111 #if BOOST_PP_NOT_EQUAL(MAXNOTOKENS,0)112 #define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, ;)113 #define BOOST_PP_LOCAL_LIMITS (0, MAX NOTOKENS-1)99 #if defined paramtypes && defined paramreferences 100 #define BOOST_PP_LOCAL_MACRO(n) type_print(~, n, paramtypes, paramreferences, ;) 101 #define BOOST_PP_LOCAL_LIMITS (0, MAXPARAMTYPES-1) 114 102 #include BOOST_PP_LOCAL_ITERATE() 115 #undef BOOST_PP_LOCAL_MACRO116 #undef BOOST_PP_LOCAL_LIMITS117 103 #endif 118 104 } params; … … 129 115 }; 130 116 131 #undef types 132 #undef tokens 133 #undef references 134 #undef MAXNOTOKENS 117 #undef paramtypes 118 #undef paramtokens 119 #undef paramreferences 120 #undef MAXPARAMTYPES 121 #undef statetypes 122 #undef statereferences 123 #undef MAXSTATETYPES 135 124 136 125 #undef ACTION 137 #undef ACTIONNAME138 #undef CATEGORY139 126 #undef COMMAND 140 127 #undef COMMANDFULL 141 128 #undef PARAMS 142 #undef STATE 129 130 #undef ACTIONNAME 131 #undef CATEGORY 143 132 #undef TOKEN
Note:
See TracChangeset
for help on using the changeset viewer.