Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Actions/MapOfActions.cpp

    r1cc87e rbf3817  
    55 *      Author: heber
    66 */
     7
     8// include config.h
     9#ifdef HAVE_CONFIG_H
     10#include <config.h>
     11#endif
    712
    813#include "Helpers/MemDebug.hpp"
     
    315320
    316321  // value types for the actions
    317   TypeMap["add-atom"] = &typeid(element);
     322  TypeMap["add-atom"] = &typeid(const element);
    318323  TypeMap["bond-file"] = &typeid(std::string);
    319324  TypeMap["bond-table"] = &typeid(std::string);
     
    321326  TypeMap["center-in-box"] = &typeid(BoxValue);
    322327  TypeMap["change-box"] = &typeid(BoxValue);
    323   TypeMap["change-element"] = &typeid(element);
     328  TypeMap["change-element"] = &typeid(const element);
    324329  TypeMap["change-molname"] = &typeid(std::string);
    325330  TypeMap["clear-atom-selection"] = &typeid(void);
     
    386391  TypeMap["distances"] = &typeid(VectorValue);
    387392  TypeMap["DoRotate"] = &typeid(bool);
    388   TypeMap["element"] = &typeid(element);
    389   TypeMap["elements"] = &typeid(std::vector<element *>);
     393  TypeMap["element"] = &typeid(const element);
     394  TypeMap["elements"] = &typeid(std::vector<const element *>);
    390395  TypeMap["end-step"] = &typeid(int);
    391396  TypeMap["id-mapping"] = &typeid(bool);
     
    416421  TypeEnumMap[&typeid(atom)] = Atom;
    417422  TypeEnumMap[&typeid(std::vector<atom *>)] = ListOfAtoms;
    418   TypeEnumMap[&typeid(element)] = Element;
    419   TypeEnumMap[&typeid(std::vector<element *>)] = ListOfElements;
     423  TypeEnumMap[&typeid(const element)] = Element;
     424  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElements;
    420425
    421426  // default values for any action that needs one (always string!)
     
    622627}
    623628
    624 void MapOfActions::queryCurrentValue(const char * name, class element * &_T)  {
     629void MapOfActions::queryCurrentValue(const char * name, const element * &_T)  {
    625630  int Z = -1;
    626   if (typeid( element ) == *TypeMap[name]) {
     631  if (typeid(const element ) == *TypeMap[name]) {
    627632    if (CurrentValue.find(name) == CurrentValue.end())
    628633      throw MissingValueException(__FILE__, __LINE__);
     
    706711}
    707712
    708 void MapOfActions::queryCurrentValue(const char * name, std::vector<element *>&_T)
     713void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T)
    709714{
    710715  int Z = -1;
    711   element *elemental = NULL;
    712   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     716  const element *elemental = NULL;
     717  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    713718    if (CurrentValue.find(name) == CurrentValue.end())
    714719      throw MissingValueException(__FILE__, __LINE__);
     
    758763}
    759764
    760 void MapOfActions::setCurrentValue(const char * name, class element * &_T)
    761 {
    762   if (typeid( element ) == *TypeMap[name]) {
     765void MapOfActions::setCurrentValue(const char * name, const element * &_T)
     766{
     767  if (typeid(const element ) == *TypeMap[name]) {
    763768    std::ostringstream stream;
    764769    stream << _T->Z;
     
    818823}
    819824
    820 void MapOfActions::setCurrentValue(const char * name, std::vector<element *>&_T)
    821 {
    822   if (typeid( std::vector<element *> ) == *TypeMap[name]) {
     825void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T)
     826{
     827  if (typeid( std::vector<const element *> ) == *TypeMap[name]) {
    823828    std::ostringstream stream;
    824     for (std::vector<element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
     829    for (std::vector<const element *>::iterator iter = _T.begin(); iter != _T.end(); ++iter) {
    825830      stream << (*iter)->Z << " ";
    826831    }
Note: See TracChangeset for help on using the changeset viewer.