LCOV - code coverage report
Current view: top level - src/module - RestrictToRegion.cpp (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 6 12 50.0 %
Date: 2024-04-29 14:43:01 Functions: 2 3 66.7 %

          Line data    Source code
       1             : #include "crpropa/module/RestrictToRegion.h" 
       2             : 
       3             : #include <sstream>
       4             : 
       5             : namespace crpropa {
       6             : 
       7           1 : RestrictToRegion::RestrictToRegion(Module* _module, Surface* _surface) : module(_module), surface(_surface) { 
       8           1 : };
       9             : 
      10           2 : void RestrictToRegion::process(Candidate *candidate) const {
      11           2 :         if (surface->distance(candidate->current.getPosition()) <= 0) {
      12           1 :                 module->process(candidate);
      13             :         }
      14           2 : };
      15             : 
      16           0 : std::string RestrictToRegion::getDescription() const {
      17           0 :         std::stringstream s;
      18             :         s << "RestrictToArea:\n"
      19           0 :                 << "  Module: " << module->getDescription() << std::endl
      20           0 :                 << "  Region: " << surface->getDescription() << std::endl;
      21           0 :         return s.str();
      22           0 : };
      23             : 
      24             : 
      25             : } // namespace crpropa

Generated by: LCOV version 1.14