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

Helper for source morphology. More...

#include <JMorphology.hh>

Inheritance diagram for JASTRONOMY::JMorphology_t:
JLANG::JTitle

Public Member Functions

 JMorphology_t ()
 Default constructor.
 
void put (const std::string &key, JMorphology *morphology)
 Put source morphology at given key.
 
const std::string & getTitle () const
 Get title.
 
void setTitle (const std::string &title)
 Set title.
 

Protected Attributes

std::map< std::string, std::shared_ptr< JMorphology > > dictionary
 
std::string title
 

Friends

std::istream & operator>> (std::istream &in, JMorphology_t &object)
 Read source morphology from input stream.
 
std::ostream & operator<< (std::ostream &out, const JMorphology_t &object)
 Write source morphology to output stream.
 

Detailed Description

Helper for source morphology.

Definition at line 494 of file JMorphology.hh.

Constructor & Destructor Documentation

◆ JMorphology_t()

JASTRONOMY::JMorphology_t::JMorphology_t ( )
inline

Default constructor.

Definition at line 501 of file JMorphology.hh.

502 {
503 dictionary["Point"] .reset(new JMorphologyPoint());
504 dictionary["Gauss"] .reset(new JMorphologyGauss());
505 dictionary["Gauss2D"] .reset(new JMorphologyGauss2D());
506 dictionary["Binary"] .reset(new JMorphologyBinary());
507 dictionary["Histogram"].reset(new JMorphologyHistogram());
508 }
std::map< std::string, std::shared_ptr< JMorphology > > dictionary

Member Function Documentation

◆ put()

void JASTRONOMY::JMorphology_t::put ( const std::string & key,
JMorphology * morphology )
inline

Put source morphology at given key.

Parameters
keykey
morphologymorphology

Definition at line 517 of file JMorphology.hh.

518 {
519 return dictionary[key].reset(morphology);
520 }

◆ getTitle()

const std::string & JLANG::JTitle::getTitle ( ) const
inlineinherited

Get title.

Returns
title

Definition at line 55 of file JTitle.hh.

56 {
57 return this->title;
58 }
std::string title
Definition JTitle.hh:73

◆ setTitle()

void JLANG::JTitle::setTitle ( const std::string & title)
inlineinherited

Set title.

Parameters
titletitle

Definition at line 66 of file JTitle.hh.

67 {
68 this->title = title;
69 }

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JMorphology_t & object )
friend

Read source morphology from input stream.

Parameters
ininput stream
objectsource morphology
Returns
input stream

Definition at line 530 of file JMorphology.hh.

531 {
532 using namespace std;
533
534 string key;
535
536 if (in >> key) {
537
538 if (object.dictionary.count(key)) {
539
540 static_cast<std::shared_ptr<JMorphology>&>(object) = object.dictionary[key];
541
542 object.setTitle(key);
543
544 object->read(in);
545
546 } else {
547
548 THROW(JParseError, "Invalid key " << key);
549 }
550 }
551
552 return in;
553 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JMorphology_t & object )
friend

Write source morphology to output stream.

Parameters
outoutput stream
objectsource morphology
Returns
output stream

Definition at line 563 of file JMorphology.hh.

564 {
565 out << object.getTitle() << ' ';
566
567 if (static_cast<const std::shared_ptr<JMorphology>&>(object)) {
568 object->write(out);
569 }
570
571 return out;
572 }

Member Data Documentation

◆ dictionary

std::map<std::string, std::shared_ptr<JMorphology> > JASTRONOMY::JMorphology_t::dictionary
protected

Definition at line 575 of file JMorphology.hh.

◆ title

std::string JLANG::JTitle::title
protectedinherited

Definition at line 73 of file JTitle.hh.


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