Jpp 20.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JMorphologyHelper Struct Reference

Helper data structure for source morphology I/O. More...

#include <JMorphology.hh>

Inheritance diagram for JASTRONOMY::JMorphologyHelper:
std::map< std::string, morphology_type >

Public Member Functions

 JMorphologyHelper ()
 Default constructor.
 
std::istream & operator() (std::istream &in, morphology_type &object) const
 Parse source morphology from input stream.
 

Detailed Description

Helper data structure for source morphology I/O.

Definition at line 495 of file JMorphology.hh.

Constructor & Destructor Documentation

◆ JMorphologyHelper()

JASTRONOMY::JMorphologyHelper::JMorphologyHelper ( )
inline

Default constructor.

Definition at line 501 of file JMorphology.hh.

502 {
503 (*this)["Point"] .reset(new JMorphologyPoint());
504 (*this)["Gauss"] .reset(new JMorphologyGauss());
505 (*this)["Gauss2D"] .reset(new JMorphologyGauss2D());
506 (*this)["Binary"] .reset(new JMorphologyBinary());
507 (*this)["Histogram"].reset(new JMorphologyHistogram());
508 }

Member Function Documentation

◆ operator()()

std::istream & JASTRONOMY::JMorphologyHelper::operator() ( std::istream & in,
morphology_type & object ) const
inline

Parse source morphology from input stream.

Parameters
ininput stream
objectsource morphology
Returns
input stream

Definition at line 518 of file JMorphology.hh.

519 {
520 std::string key;
521
522 if (in >> key) {
523
524 const_iterator p = this->find(key);
525
526 if (p != this->end()) {
527
528 object.reset(p->second->clone());
529
530 object->setTitle(key);
531 object->read(in);
532
533 } else {
534
535 THROW(JParseError, "Invalid key " << key);
536 }
537 }
538
539 return in;
540 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

The documentation for this struct was generated from the following file: