Jpp test-rotations-old-533-g2bdbdb559
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JMorphology_t Struct Reference

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

#include <JMorphology.hh>

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

Public Types

typedef std::map< std::string, morphology_typedictionary_type
 

Public Member Functions

 JMorphology_t ()
 Default constructor.
 
const dictionary_typegetDictionary () const
 Get dictionary.
 
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

dictionary_type 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 I/O.

Definition at line 491 of file JMorphology.hh.

Member Typedef Documentation

◆ dictionary_type

Constructor & Destructor Documentation

◆ JMorphology_t()

JASTRONOMY::JMorphology_t::JMorphology_t ( )
inline

Default constructor.

Definition at line 500 of file JMorphology.hh.

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

Member Function Documentation

◆ getDictionary()

const dictionary_type & JASTRONOMY::JMorphology_t::getDictionary ( ) const
inline

Get dictionary.

Returns
dictionary

Definition at line 515 of file JMorphology.hh.

516 {
517 return dictionary;
518 }

◆ 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 527 of file JMorphology.hh.

528 {
529 return dictionary[key].reset(morphology);
530 }

◆ 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 540 of file JMorphology.hh.

541 {
542 using namespace std;
543
544 string key;
545
546 if (in >> key) {
547
548 if (object.dictionary.count(key)) {
549
550 static_cast<shared_ptr<JMorphology>&>(object) = object.dictionary[key];
551
552 object.setTitle(key);
553
554 object->read(in);
555
556 } else {
557
558 THROW(JParseError, "Invalid key " << key);
559 }
560 }
561
562 return in;
563 }
#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 573 of file JMorphology.hh.

574 {
575 out << object.getTitle() << ' ';
576
577 if (static_cast<const std::shared_ptr<JMorphology>&>(object)) {
578 object->write(out);
579 }
580
581 return out;
582 }

Member Data Documentation

◆ dictionary

dictionary_type JASTRONOMY::JMorphology_t::dictionary
protected

Definition at line 585 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: