Ignore:
Timestamp:
May 8, 2017, 1:54:50 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_goodresults, ForceAnnealing_tocheck
Children:
5f0ddd
Parents:
d7bd62
git-author:
Frederik Heber <heber@…> (03/31/17 09:03:09)
git-committer:
Frederik Heber <frederik.heber@…> (05/08/17 13:54:50)
Message:

GeometryRegistry knows a list of protected names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Geometry/GeometryRegistry.cpp

    rd7bd62 r369409  
    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)
Note: See TracChangeset for help on using the changeset viewer.