Changeset fd4e8c


Ignore:
Timestamp:
Jun 19, 2017, 8:24:17 AM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChangeBugEmailaddress, ChemicalSpaceEvaluator, EmpiricalPotential_contain_HomologyGraph_documentation, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_oldresults, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps
Children:
836972
Parents:
1ba51c
git-author:
Frederik Heber <heber@…> (03/31/17 09:03:09)
git-committer:
Frederik Heber <frederik.heber@…> (06/19/17 08:24:17)
Message:

GeometryRegistry knows a list of protected names.

Location:
src/Geometry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Geometry/GeometryRegistry.cpp

    r1ba51c rfd4e8c  
    3737#include "GeometryRegistry.hpp"
    3838
     39#include <algorithm>
     40#include <boost/assign.hpp>
     41
    3942#include "CodePatterns/Singleton_impl.hpp"
    4043#include "CodePatterns/Registry_impl.hpp"
    4144#include "CodePatterns/Observer/Channels.hpp"
     45
     46using namespace boost::assign;
    4247
    4348GeometryRegistry::GeometryRegistry() :
     
    9398}
    9499
     100static std::vector<std::string> setProtectedNames()
     101{
     102  std::vector<std::string> names;
     103  names += std::string("zeroVector"),
     104      std::string("unitVectorX"),
     105      std::string("unitVectorY"),
     106      std::string("unitVectorZ");
     107  return names;
     108}
     109
     110bool GeometryRegistry::isProtectedName(const std::string &_name) const
     111{
     112  static std::vector<std::string> protected_names = setProtectedNames();
     113
     114  if (std::count(protected_names.begin(), protected_names.end(), _name) != 0)
     115    return true;
     116  return false;
     117}
     118
    95119CONSTRUCT_SINGLETON(GeometryRegistry)
    96120CONSTRUCT_REGISTRY(GeometryObject)
  • src/Geometry/GeometryRegistry.hpp

    r1ba51c rfd4e8c  
    4646  GeometryObject *lastChanged() const { return _lastchanged;  }
    4747
     48  bool isProtectedName(const std::string &_name) const;
     49
    4850private:
    4951  void fillRegistry();
Note: See TracChangeset for help on using the changeset viewer.