Changes in src/Actions/MapOfActions.cpp [1cc87e:bf3817]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Actions/MapOfActions.cpp ¶
r1cc87e rbf3817 5 5 * Author: heber 6 6 */ 7 8 // include config.h 9 #ifdef HAVE_CONFIG_H 10 #include <config.h> 11 #endif 7 12 8 13 #include "Helpers/MemDebug.hpp" … … 315 320 316 321 // value types for the actions 317 TypeMap["add-atom"] = &typeid( element);322 TypeMap["add-atom"] = &typeid(const element); 318 323 TypeMap["bond-file"] = &typeid(std::string); 319 324 TypeMap["bond-table"] = &typeid(std::string); … … 321 326 TypeMap["center-in-box"] = &typeid(BoxValue); 322 327 TypeMap["change-box"] = &typeid(BoxValue); 323 TypeMap["change-element"] = &typeid( element);328 TypeMap["change-element"] = &typeid(const element); 324 329 TypeMap["change-molname"] = &typeid(std::string); 325 330 TypeMap["clear-atom-selection"] = &typeid(void); … … 386 391 TypeMap["distances"] = &typeid(VectorValue); 387 392 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 *>); 390 395 TypeMap["end-step"] = &typeid(int); 391 396 TypeMap["id-mapping"] = &typeid(bool); … … 416 421 TypeEnumMap[&typeid(atom)] = Atom; 417 422 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; 420 425 421 426 // default values for any action that needs one (always string!) … … 622 627 } 623 628 624 void MapOfActions::queryCurrentValue(const char * name, c lasselement * &_T) {629 void MapOfActions::queryCurrentValue(const char * name, const element * &_T) { 625 630 int Z = -1; 626 if (typeid( element ) == *TypeMap[name]) {631 if (typeid(const element ) == *TypeMap[name]) { 627 632 if (CurrentValue.find(name) == CurrentValue.end()) 628 633 throw MissingValueException(__FILE__, __LINE__); … … 706 711 } 707 712 708 void MapOfActions::queryCurrentValue(const char * name, std::vector< element *>&_T)713 void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T) 709 714 { 710 715 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]) { 713 718 if (CurrentValue.find(name) == CurrentValue.end()) 714 719 throw MissingValueException(__FILE__, __LINE__); … … 758 763 } 759 764 760 void MapOfActions::setCurrentValue(const char * name, c lasselement * &_T)761 { 762 if (typeid( element ) == *TypeMap[name]) {765 void MapOfActions::setCurrentValue(const char * name, const element * &_T) 766 { 767 if (typeid(const element ) == *TypeMap[name]) { 763 768 std::ostringstream stream; 764 769 stream << _T->Z; … … 818 823 } 819 824 820 void MapOfActions::setCurrentValue(const char * name, std::vector< element *>&_T)821 { 822 if (typeid( std::vector< element *> ) == *TypeMap[name]) {825 void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T) 826 { 827 if (typeid( std::vector<const element *> ) == *TypeMap[name]) { 823 828 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) { 825 830 stream << (*iter)->Z << " "; 826 831 }
Note:
See TracChangeset
for help on using the changeset viewer.