Changeset 4885f85 for src/Actions
- Timestamp:
- Oct 30, 2010, 6:44:29 PM (14 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:
- bc2990
- Parents:
- a8188d
- git-author:
- Frederik Heber <heber@…> (10/26/10 09:27:08)
- git-committer:
- Frederik Heber <heber@…> (10/30/10 18:44:29)
- Location:
- src/Actions
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MapOfActions.cpp
ra8188d r4885f85 1225 1225 * \return Description of the action 1226 1226 */ 1227 std::string MapOfActions::getDescription(string actionname)1227 const std::string MapOfActions::getDescription(string actionname) 1228 1228 { 1229 1229 ASSERT(DescriptionMap.find(actionname) != DescriptionMap.end(), "Unknown action name passed to MapOfActions::getDescription"); … … 1239 1239 * \return actionname,ShortForm or Description of the action 1240 1240 */ 1241 std::string MapOfActions::getKeyAndShortForm(string actionname)1241 const std::string MapOfActions::getKeyAndShortForm(string actionname) 1242 1242 { 1243 1243 stringstream output; … … 1254 1254 * \return ShortForm of the action 1255 1255 */ 1256 std::string MapOfActions::getShortForm(string actionname) 1257 { 1258 ASSERT(ShortFormMap.find(actionname) != ShortFormMap.end(), "Unknown action name passed to MapOfActions::getShortForm"); 1259 return ShortFormMap[actionname]; 1256 const std::string MapOfActions::getShortForm(string actionname) 1257 { 1258 if (ShortFormMap.find(actionname) != ShortFormMap.end()) 1259 return ShortFormMap[actionname]; 1260 else 1261 return std::string(); 1262 } 1263 1264 /** Getter for MapOfActions:CurrentValueMap. 1265 * Note that we assert when action does not exist in CommandLineParser::CurrentValueMap. 1266 * \param actionname name of the action to lookup 1267 * \return CurrentValueMap of the action 1268 */ 1269 const std::string MapOfActions::getCurrentValue(string actionname) 1270 { 1271 if (CurrentValueMap.find(actionname) != CurrentValueMap.end()) 1272 return CurrentValueMap[actionname]; 1273 else 1274 return std::string(); 1260 1275 } 1261 1276 … … 1269 1284 } 1270 1285 1286 /** Getter for MapOfActions::TypeMap::name. 1287 * \param actionname name of the action to look up 1288 * \return name of type of the action 1289 */ 1290 const std::string MapOfActions::getValueType(string actionname) 1291 { 1292 return TypeMap[actionname]->name(); 1293 } 1294 1271 1295 /** Getter for MapOfActions::TypeMap. 1272 1296 * \param actionname name of the action to look up 1273 1297 * \return type of the action 1274 1298 */ 1275 std::string MapOfActions::getValueType(string actionname)1276 { 1277 return TypeMap[actionname] ->name();1299 const std::type_info * MapOfActions::getType(string actionname) 1300 { 1301 return TypeMap[actionname]; 1278 1302 } 1279 1303 -
src/Actions/MapOfActions.hpp
ra8188d r4885f85 141 141 142 142 // getter for the action descriptions and short forms 143 std::string getDescription(std::string actionname);144 std::string getKeyAndShortForm(std::string actionname);145 std::string getShortForm(std::string actionname);143 const std::string getDescription(std::string actionname); 144 const std::string getKeyAndShortForm(std::string actionname); 145 const std::string getShortForm(std::string actionname); 146 146 std::map <std::string, std::string> getShortFormToActionMap(); 147 const std::string getCurrentValue(std::string actionname); 147 148 148 149 void AddOptionsToParser(); … … 151 152 bool hasValue(std::string actionname); 152 153 bool isShortFormPresent(std::string shortform); 153 std::string getValueType(std::string actionname); 154 const std::string getValueType(std::string actionname); 155 const std::type_info * getType(std::string actionname); 154 156 155 157 std::set<std::string> generic; -
src/Actions/ValueStorage.cpp
ra8188d r4885f85 29 29 ValueStorage::~ValueStorage() {}; 30 30 31 std::string ValueStorage::getDescription(std::string actionname) { 31 const std::string ValueStorage::getCurrentValue(std::string actionname) { 32 return MapOfActions::getInstance().getCurrentValue(actionname); 33 } 34 35 const std::string ValueStorage::getDescription(std::string actionname) { 32 36 return MapOfActions::getInstance().getDescription(actionname); 33 37 } 34 38 39 const std::string ValueStorage::getShortForm(std::string actionname) { 40 return MapOfActions::getInstance().getShortForm(actionname); 41 } 42 43 const std::type_info * ValueStorage::getType(std::string actionname) { 44 return MapOfActions::getInstance().getType(actionname); 45 } 46 35 47 CONSTRUCT_SINGLETON(ValueStorage) -
src/Actions/ValueStorage.hpp
ra8188d r4885f85 48 48 * \return text describing the key's contents 49 49 */ 50 std::string getDescription(std::string actionname); 50 const std::string getCurrentValue(std::string actionname); 51 const std::string getDescription(std::string actionname); 52 const std::string getShortForm(std::string actionname); 53 const std::type_info * getType(std::string actionname); 51 54 52 55 protected:
Note:
See TracChangeset
for help on using the changeset viewer.