Ignore:
Timestamp:
Oct 30, 2010, 6:44:28 PM (14 years ago)
Author:
Frederik Heber <heber@…>
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:
4885f85
Parents:
df32ee
git-author:
Frederik Heber <heber@…> (10/26/10 09:20:41)
git-committer:
Frederik Heber <heber@…> (10/30/10 18:44:28)
Message:

Renaming MapOfActions::CurrentValue -> CurrentValueMap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MapOfActions.cpp

    rdf32ee ra8188d  
    2828#include "Patterns/Singleton_impl.hpp"
    2929
     30#include <boost/filesystem.hpp>
    3031#include <boost/lexical_cast.hpp>
    3132#include <boost/optional.hpp>
    3233#include <boost/program_options.hpp>
    33 #include <boost/filesystem.hpp>
    3434
    3535#include <iostream>
     
    480480
    481481  // default values for any action that needs one (always string!)
    482   CurrentValue["bin-width"] = "0.5";
    483   CurrentValue["fastparsing"] = "0";
    484   CurrentValue["periodic"] = "0";
     482  CurrentValueMap["bin-width"] = "0.5";
     483  CurrentValueMap["fastparsing"] = "0";
     484  CurrentValueMap["periodic"] = "0";
    485485
    486486  // put action into each menu category
     
    691691bool MapOfActions::isCurrentValuePresent(const char *name) const
    692692{
    693   return (CurrentValue.find(name) != CurrentValue.end());
     693  return (CurrentValueMap.find(name) != CurrentValueMap.end());
    694694}
    695695
     
    698698  int atomID = -1;
    699699  if (typeid( atom ) == *TypeMap[name]) {
    700     if (CurrentValue.find(name) == CurrentValue.end())
     700    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    701701      throw MissingValueException(__FILE__, __LINE__);
    702     atomID = lexical_cast<int>(CurrentValue[name].c_str());
    703     CurrentValue.erase(name);
     702    atomID = lexical_cast<int>(CurrentValueMap[name].c_str());
     703    CurrentValueMap.erase(name);
    704704  } else
    705705    throw IllegalTypeException(__FILE__,__LINE__);
     
    710710  int Z = -1;
    711711  if (typeid(const element ) == *TypeMap[name]) {
    712     if (CurrentValue.find(name) == CurrentValue.end())
     712    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    713713      throw MissingValueException(__FILE__, __LINE__);
    714     Z = lexical_cast<int>(CurrentValue[name].c_str());
    715     CurrentValue.erase(name);
     714    Z = lexical_cast<int>(CurrentValueMap[name].c_str());
     715    CurrentValueMap.erase(name);
    716716  } else
    717717    throw IllegalTypeException(__FILE__,__LINE__);
     
    722722  int molID = -1;
    723723  if (typeid( molecule ) == *TypeMap[name]) {
    724     if (CurrentValue.find(name) == CurrentValue.end())
     724    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    725725      throw MissingValueException(__FILE__, __LINE__);
    726     molID = lexical_cast<int>(CurrentValue[name].c_str());
    727     CurrentValue.erase(name);
     726    molID = lexical_cast<int>(CurrentValueMap[name].c_str());
     727    CurrentValueMap.erase(name);
    728728  } else
    729729    throw IllegalTypeException(__FILE__,__LINE__);
     
    735735  double tmp;
    736736  if (typeid( BoxValue ) == *TypeMap[name]) {
    737     if (CurrentValue.find(name) == CurrentValue.end())
     737    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    738738      throw MissingValueException(__FILE__, __LINE__);
    739     std::istringstream stream(CurrentValue[name]);
     739    std::istringstream stream(CurrentValueMap[name]);
    740740    stream >> tmp;
    741741    M.set(0,0,tmp);
     
    754754    M.set(2,2,tmp);
    755755    _T = M;
    756     CurrentValue.erase(name);
     756    CurrentValueMap.erase(name);
    757757  } else
    758758    throw IllegalTypeException(__FILE__,__LINE__);
     
    761761void MapOfActions::queryCurrentValue(const char * name, class Vector &_T) {
    762762  if (typeid( VectorValue ) == *TypeMap[name]) {
    763     std::istringstream stream(CurrentValue[name]);
    764     CurrentValue.erase(name);
     763    std::istringstream stream(CurrentValueMap[name]);
     764    CurrentValueMap.erase(name);
    765765    stream >> _T[0];
    766766    stream >> _T[1];
     
    772772void MapOfActions::queryCurrentValue(const char * name, class BoxVector &_T) {
    773773  if (typeid( VectorValue ) == *TypeMap[name]) {
    774     std::istringstream stream(CurrentValue[name]);
    775     CurrentValue.erase(name);
     774    std::istringstream stream(CurrentValueMap[name]);
     775    CurrentValueMap.erase(name);
    776776    stream >> _T[0];
    777777    stream >> _T[1];
     
    786786  atom *Walker = NULL;
    787787  if (typeid( std::vector<atom *> ) == *TypeMap[name]) {
    788     if (CurrentValue.find(name) == CurrentValue.end())
     788    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    789789      throw MissingValueException(__FILE__, __LINE__);
    790     std::istringstream stream(CurrentValue[name]);
    791     CurrentValue.erase(name);
     790    std::istringstream stream(CurrentValueMap[name]);
     791    CurrentValueMap.erase(name);
    792792    while (!stream.fail()) {
    793793      stream >> atomID >> ws;
     
    807807  const element *elemental = NULL;
    808808  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    809     if (CurrentValue.find(name) == CurrentValue.end())
     809    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    810810      throw MissingValueException(__FILE__, __LINE__);
    811     std::istringstream stream(CurrentValue[name]);
    812     CurrentValue.erase(name);
     811    std::istringstream stream(CurrentValueMap[name]);
     812    CurrentValueMap.erase(name);
    813813    while (!stream.fail()) {
    814814      stream >> Z >> ws;
     
    827827  molecule *mol = NULL;
    828828  if (typeid( std::vector<molecule *> ) == *TypeMap[name]) {
    829     if (CurrentValue.find(name) == CurrentValue.end())
     829    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    830830      throw MissingValueException(__FILE__, __LINE__);
    831     std::istringstream stream(CurrentValue[name]);
    832     CurrentValue.erase(name);
     831    std::istringstream stream(CurrentValueMap[name]);
     832    CurrentValueMap.erase(name);
    833833    while (!stream.fail()) {
    834834      stream >> molID >> ws;
     
    847847  std::string tmp;
    848848  if (typeid( boost::filesystem::path ) == *TypeMap[name]) {
    849     if (CurrentValue.find(name) == CurrentValue.end())
     849    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    850850      throw MissingValueException(__FILE__, __LINE__);
    851     std::istringstream stream(CurrentValue[name]);
    852     CurrentValue.erase(name);
     851    std::istringstream stream(CurrentValueMap[name]);
     852    CurrentValueMap.erase(name);
    853853    if (!stream.fail()) {
    854854      stream >> tmp >> ws;
     
    859859}
    860860
    861 
    862861void MapOfActions::setCurrentValue(const char * name, class atom * &_T)
    863862{
     
    865864    std::ostringstream stream;
    866865    stream << _T->getId();
    867     CurrentValue[name] = stream.str();
     866    CurrentValueMap[name] = stream.str();
    868867  } else
    869868    throw IllegalTypeException(__FILE__,__LINE__);
     
    875874    std::ostringstream stream;
    876875    stream << _T->getAtomicNumber();
    877     CurrentValue[name] = stream.str();
     876    CurrentValueMap[name] = stream.str();
    878877  } else
    879878    throw IllegalTypeException(__FILE__,__LINE__);
     
    885884    std::ostringstream stream;
    886885    stream << _T->getId();
    887     CurrentValue[name] = stream.str();
     886    CurrentValueMap[name] = stream.str();
    888887  } else
    889888    throw IllegalTypeException(__FILE__,__LINE__);
     
    901900    stream << M.at(1,2) << " ";
    902901    stream << M.at(2,2) << " ";
    903     CurrentValue[name] = stream.str();
     902    CurrentValueMap[name] = stream.str();
    904903  } else
    905904    throw IllegalTypeException(__FILE__,__LINE__);
     
    913912    stream << _T[1] << " ";
    914913    stream << _T[2] << " ";
    915     CurrentValue[name] = stream.str();
     914    CurrentValueMap[name] = stream.str();
    916915  } else
    917916    throw IllegalTypeException(__FILE__,__LINE__);
     
    925924    stream << _T[1] << " ";
    926925    stream << _T[2] << " ";
    927     CurrentValue[name] = stream.str();
     926    CurrentValueMap[name] = stream.str();
    928927  } else
    929928    throw IllegalTypeException(__FILE__,__LINE__);
     
    937936      stream << (*iter)->getId() << " ";
    938937    }
    939     CurrentValue[name] = stream.str();
     938    CurrentValueMap[name] = stream.str();
    940939  } else
    941940    throw IllegalTypeException(__FILE__,__LINE__);
     
    949948      stream << (*iter)->getAtomicNumber() << " ";
    950949    }
    951     CurrentValue[name] = stream.str();
     950    CurrentValueMap[name] = stream.str();
    952951  } else
    953952    throw IllegalTypeException(__FILE__,__LINE__);
     
    961960      stream << (*iter)->getId() << " ";
    962961    }
    963     CurrentValue[name] = stream.str();
     962    CurrentValueMap[name] = stream.str();
    964963  } else
    965964    throw IllegalTypeException(__FILE__,__LINE__);
     
    971970    std::ostringstream stream;
    972971    stream << _T.string();
    973     CurrentValue[name] = stream.str();
     972    CurrentValueMap[name] = stream.str();
    974973  } else
    975974    throw IllegalTypeException(__FILE__,__LINE__);
     
    10821081            ListRunner->second->add_options()
    10831082              (getKeyAndShortForm(*OptionRunner).c_str(),
    1084                   CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    1085                         po::value< bool >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
     1083                  CurrentValueMap.find(*OptionRunner) != CurrentValueMap.end() ?
     1084                        po::value< bool >()->default_value(lexical_cast<int>(CurrentValueMap[*OptionRunner].c_str())) :
    10861085                        po::value< bool >(),
    10871086                  getDescription(*OptionRunner).c_str())
     
    11051104            ListRunner->second->add_options()
    11061105              (getKeyAndShortForm(*OptionRunner).c_str(),
    1107                   CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    1108                         po::value< int >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
     1106                  CurrentValueMap.find(*OptionRunner) != CurrentValueMap.end() ?
     1107                        po::value< int >()->default_value(lexical_cast<int>(CurrentValueMap[*OptionRunner].c_str())) :
    11091108                        po::value< int >(),
    11101109                  getDescription(*OptionRunner).c_str())
     
    11211120            ListRunner->second->add_options()
    11221121              (getKeyAndShortForm(*OptionRunner).c_str(),
    1123                   CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    1124                         po::value< double >()->default_value(lexical_cast<double>(CurrentValue[*OptionRunner].c_str())) :
     1122                  CurrentValueMap.find(*OptionRunner) != CurrentValueMap.end() ?
     1123                        po::value< double >()->default_value(lexical_cast<double>(CurrentValueMap[*OptionRunner].c_str())) :
    11251124                        po::value< double >(),
    11261125                  getDescription(*OptionRunner).c_str())
     
    11371136            ListRunner->second->add_options()
    11381137              (getKeyAndShortForm(*OptionRunner).c_str(),
    1139                   CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    1140                         po::value< std::string >()->default_value(CurrentValue[*OptionRunner]) :
     1138                  CurrentValueMap.find(*OptionRunner) != CurrentValueMap.end() ?
     1139                        po::value< std::string >()->default_value(CurrentValueMap[*OptionRunner]) :
    11411140                        po::value< std::string >(),
    11421141                  getDescription(*OptionRunner).c_str())
     
    11671166            ListRunner->second->add_options()
    11681167              (getKeyAndShortForm(*OptionRunner).c_str(),
    1169                   CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    1170                         po::value< int >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
     1168                  CurrentValueMap.find(*OptionRunner) != CurrentValueMap.end() ?
     1169                        po::value< int >()->default_value(lexical_cast<int>(CurrentValueMap[*OptionRunner].c_str())) :
    11711170                        po::value< int >(),
    11721171                  getDescription(*OptionRunner).c_str())
     
    11831182            ListRunner->second->add_options()
    11841183              (getKeyAndShortForm(*OptionRunner).c_str(),
    1185                   CurrentValue.find(*OptionRunner) != CurrentValue.end() ?
    1186                         po::value< int >()->default_value(lexical_cast<int>(CurrentValue[*OptionRunner].c_str())) :
     1184                  CurrentValueMap.find(*OptionRunner) != CurrentValueMap.end() ?
     1185                        po::value< int >()->default_value(lexical_cast<int>(CurrentValueMap[*OptionRunner].c_str())) :
    11871186                        po::value< int >(),
    11881187                  getDescription(*OptionRunner).c_str())
Note: See TracChangeset for help on using the changeset viewer.