OGS
ChemistryLib::PhreeqcIOData::Output Struct Reference

Detailed Description

Definition at line 80 of file Output.h.

#include <Output.h>

Collaboration diagram for ChemistryLib::PhreeqcIOData::Output:
[legend]

Public Member Functions

 Output (BasicOutputSetups &&basic_output_setups_, std::vector< OutputItem > &&accepted_items_, std::vector< int > &&dropped_item_ids_)
 
std::vector< OutputItemgetOutputItemsByItemType (ItemType item_type) const
 

Public Attributes

BasicOutputSetups const basic_output_setups
 
std::vector< OutputItem > const accepted_items
 
std::vector< int > const dropped_item_ids
 

Friends

std::ostream & operator<< (std::ostream &os, Output const &output)
 

Constructor & Destructor Documentation

◆ Output()

ChemistryLib::PhreeqcIOData::Output::Output ( BasicOutputSetups && basic_output_setups_,
std::vector< OutputItem > && accepted_items_,
std::vector< int > && dropped_item_ids_ )
inline

Definition at line 82 of file Output.h.

85 : basic_output_setups(std::move(basic_output_setups_)),
86 accepted_items(std::move(accepted_items_)),
87 dropped_item_ids(std::move(dropped_item_ids_))
88 {
89 }
std::vector< int > const dropped_item_ids
Definition Output.h:106
std::vector< OutputItem > const accepted_items
Definition Output.h:105
BasicOutputSetups const basic_output_setups
Definition Output.h:104

Member Function Documentation

◆ getOutputItemsByItemType()

std::vector< OutputItem > ChemistryLib::PhreeqcIOData::Output::getOutputItemsByItemType ( ItemType item_type) const
inline

Definition at line 91 of file Output.h.

92 {
93 std::vector<OutputItem> matching_items;
94 std::copy_if(accepted_items.cbegin(),
95 accepted_items.cend(),
96 std::back_inserter(matching_items),
97 [&item_type](OutputItem const& accepted_item)
98 { return accepted_item.item_type == item_type; });
99 return matching_items;
100 }

References accepted_items.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Output const & output )
friend

Definition at line 66 of file Output.cpp.

67{
68 os << output.basic_output_setups;
69
70 auto const component_items =
71 output.getOutputItemsByItemType(ItemType::Component);
72 os << "-totals";
73 for (auto const& component_item : component_items)
74 {
75 os << " " << component_item.name;
76 }
77 os << "\n";
78
79 auto const equilibrium_phase_items =
80 output.getOutputItemsByItemType(ItemType::EquilibriumReactant);
81 if (!equilibrium_phase_items.empty())
82 {
83 os << "-equilibrium_phases";
84 for (auto const& equilibrium_phase_item : equilibrium_phase_items)
85 {
86 os << " " << equilibrium_phase_item.name;
87 }
88 os << "\n";
89 }
90
91 auto const kinetic_reactant_items =
92 output.getOutputItemsByItemType(ItemType::KineticReactant);
93 if (!kinetic_reactant_items.empty())
94 {
95 os << "-kinetic_reactants";
96 for (auto const& kinetic_reactant_item : kinetic_reactant_items)
97 {
98 os << " " << kinetic_reactant_item.name;
99 }
100 os << "\n";
101 }
102
103 return os;
104}

Member Data Documentation

◆ accepted_items

std::vector<OutputItem> const ChemistryLib::PhreeqcIOData::Output::accepted_items

Definition at line 105 of file Output.h.

Referenced by getOutputItemsByItemType().

◆ basic_output_setups

BasicOutputSetups const ChemistryLib::PhreeqcIOData::Output::basic_output_setups

Definition at line 104 of file Output.h.

◆ dropped_item_ids

std::vector<int> const ChemistryLib::PhreeqcIOData::Output::dropped_item_ids

Definition at line 106 of file Output.h.


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