Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/MapOfActions.cpp

    r952f38 re5c0a1  
    2626#include "CommandLineParser.hpp"
    2727#include "element.hpp"
    28 #include "Helpers/Log.hpp"
    29 #include "LinearAlgebra/Matrix.hpp"
     28#include "log.hpp"
     29#include "Matrix.hpp"
    3030#include "molecule.hpp"
    3131#include "periodentafel.hpp"
    32 #include "LinearAlgebra/Vector.hpp"
    33 #include "Helpers/Verbose.hpp"
     32#include "vector.hpp"
     33#include "verbose.hpp"
    3434
    3535#include "Actions/ActionRegistry.hpp"
     
    292292
    293293  // value types for the actions
    294   TypeMap["add-atom"] = &typeid(element);
     294  TypeMap["add-atom"] = &typeid(const element);
    295295  TypeMap["bond-file"] = &typeid(std::string);
    296296  TypeMap["bond-table"] = &typeid(std::string);
     
    298298  TypeMap["center-in-box"] = &typeid(BoxValue);
    299299  TypeMap["change-box"] = &typeid(BoxValue);
    300   TypeMap["change-element"] = &typeid(element);
     300  TypeMap["change-element"] = &typeid(const element);
    301301  TypeMap["change-molname"] = &typeid(std::string);
    302302  TypeMap["convex-envelope"] = &typeid(void);
     
    342342  TypeMap["distances"] = &typeid(VectorValue);
    343343  TypeMap["DoRotate"] = &typeid(bool);
    344   TypeMap["element"] = &typeid(element);
    345   TypeMap["elements"] = &typeid(std::vector<element *>);
     344  TypeMap["element"] = &typeid(const element);
     345  TypeMap["elements"] = &typeid(std::vector<const element *>);
    346346  TypeMap["end-step"] = &typeid(int);
    347347  TypeMap["id-mapping"] = &typeid(bool);
     
    380380  TypeEnumMap[&typeid(atom)] = Atom;
    381381  TypeEnumMap[&typeid(std::vector<atom *>)] = ListOfAtoms;
    382   TypeEnumMap[&typeid(element)] = Element;
    383   TypeEnumMap[&typeid(std::vector<element *>)] = ListOfElements;
     382  TypeEnumMap[&typeid(const element)] = Element;
     383  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElements;
    384384
    385385  // default values for any action that needs one (always string!)
     
    558558}
    559559
    560 void MapOfActions::queryCurrentValue(const char * name, class element * &_T)  {
     560void MapOfActions::queryCurrentValue(const char * name, const element * &_T)  {
    561561  int Z = -1;
    562   if (typeid( element ) == *TypeMap[name]) {
     562  if (typeid(const element ) == *TypeMap[name]) {
    563563    if (CurrentValue.find(name) == CurrentValue.end())
    564564      throw MissingValueException(__FILE__, __LINE__);
     
    642642}
    643643
    644 void MapOfActions::queryCurrentValue(const char * name, std::vector<element *>&_T)
     644void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T)
    645645{
    646646  int Z = -1;
    647   element *elemental = NULL;
    648   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     647  const element *elemental = NULL;
     648  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    649649    if (CurrentValue.find(name) == CurrentValue.end())
    650650      throw MissingValueException(__FILE__, __LINE__);
     
    694694}
    695695
    696 void MapOfActions::setCurrentValue(const char * name, class element * &_T)
    697 {
    698   if (typeid( element ) == *TypeMap[name]) {
     696void MapOfActions::setCurrentValue(const char * name, const element * &_T)
     697{
     698  if (typeid(const element ) == *TypeMap[name]) {
    699699    std::ostringstream stream;
    700700    stream << _T->Z;
     
    754754}
    755755
    756 void MapOfActions::setCurrentValue(const char * name, std::vector<element *>&_T)
    757 {
    758   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     756void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T)
     757{
     758  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    759759    std::ostringstream stream;
    760     for (std::vector<element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
     760    for (std::vector<const element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
    761761      stream << (*iter)->Z << " ";
    762762    }
Note: See TracChangeset for help on using the changeset viewer.