Changes in src/Actions/MapOfActions.cpp [952f38:e5c0a1]
- File:
-
- 1 edited
-
src/Actions/MapOfActions.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MapOfActions.cpp
r952f38 re5c0a1 26 26 #include "CommandLineParser.hpp" 27 27 #include "element.hpp" 28 #include " Helpers/Log.hpp"29 #include " LinearAlgebra/Matrix.hpp"28 #include "log.hpp" 29 #include "Matrix.hpp" 30 30 #include "molecule.hpp" 31 31 #include "periodentafel.hpp" 32 #include " LinearAlgebra/Vector.hpp"33 #include " Helpers/Verbose.hpp"32 #include "vector.hpp" 33 #include "verbose.hpp" 34 34 35 35 #include "Actions/ActionRegistry.hpp" … … 292 292 293 293 // value types for the actions 294 TypeMap["add-atom"] = &typeid( element);294 TypeMap["add-atom"] = &typeid(const element); 295 295 TypeMap["bond-file"] = &typeid(std::string); 296 296 TypeMap["bond-table"] = &typeid(std::string); … … 298 298 TypeMap["center-in-box"] = &typeid(BoxValue); 299 299 TypeMap["change-box"] = &typeid(BoxValue); 300 TypeMap["change-element"] = &typeid( element);300 TypeMap["change-element"] = &typeid(const element); 301 301 TypeMap["change-molname"] = &typeid(std::string); 302 302 TypeMap["convex-envelope"] = &typeid(void); … … 342 342 TypeMap["distances"] = &typeid(VectorValue); 343 343 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 *>); 346 346 TypeMap["end-step"] = &typeid(int); 347 347 TypeMap["id-mapping"] = &typeid(bool); … … 380 380 TypeEnumMap[&typeid(atom)] = Atom; 381 381 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; 384 384 385 385 // default values for any action that needs one (always string!) … … 558 558 } 559 559 560 void MapOfActions::queryCurrentValue(const char * name, c lasselement * &_T) {560 void MapOfActions::queryCurrentValue(const char * name, const element * &_T) { 561 561 int Z = -1; 562 if (typeid( element ) == *TypeMap[name]) {562 if (typeid(const element ) == *TypeMap[name]) { 563 563 if (CurrentValue.find(name) == CurrentValue.end()) 564 564 throw MissingValueException(__FILE__, __LINE__); … … 642 642 } 643 643 644 void MapOfActions::queryCurrentValue(const char * name, std::vector< element *>&_T)644 void MapOfActions::queryCurrentValue(const char * name, std::vector<const element *>&_T) 645 645 { 646 646 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]) { 649 649 if (CurrentValue.find(name) == CurrentValue.end()) 650 650 throw MissingValueException(__FILE__, __LINE__); … … 694 694 } 695 695 696 void MapOfActions::setCurrentValue(const char * name, c lasselement * &_T)697 { 698 if (typeid( element ) == *TypeMap[name]) {696 void MapOfActions::setCurrentValue(const char * name, const element * &_T) 697 { 698 if (typeid(const element ) == *TypeMap[name]) { 699 699 std::ostringstream stream; 700 700 stream << _T->Z; … … 754 754 } 755 755 756 void MapOfActions::setCurrentValue(const char * name, std::vector< element *>&_T)757 { 758 if (typeid( std::vector< element *> ) == *TypeMap[name]) {756 void MapOfActions::setCurrentValue(const char * name, std::vector<const element *>&_T) 757 { 758 if (typeid( std::vector<const element *> ) == *TypeMap[name]) { 759 759 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) { 761 761 stream << (*iter)->Z << " "; 762 762 }
Note:
See TracChangeset
for help on using the changeset viewer.
