/* * AtomsCalculation_impl.hpp * * Created on: Feb 19, 2010 * Author: crueger */ #ifndef ATOMSCALCULATION_IMPL_HPP_ #define ATOMSCALCULATION_IMPL_HPP_ #include "Actions/AtomsCalculation.hpp" #include "Actions/Calculation_impl.hpp" #include using namespace std; template AtomsCalculation::AtomsCalculation(boost::function _op,std::string name,AtomDescriptor _descr) : Calculation >(0,name,false), descr(_descr), op(_op) {} template AtomsCalculation::~AtomsCalculation(){ } template std::vector* AtomsCalculation::doCalc(){ World* world = World::getPointer(); int steps = world->numAtoms(); std::vector *res = new std::vector(); res->reserve(steps); Process::setMaxSteps(steps); Process::start(); for(World::AtomIterator iter=world->getAtomIter(descr);iter!=world->atomEnd();++iter){ Process::setCurrStep(iter.getCount()); res->push_back(op(*iter)); } Process::stop(); return res; } #endif /* ATOMSCALCULATION_IMPL_HPP_ */