![]() |
![]() |
Streaming the DDD transient store from/into a std::istream/std::ostream */. More...
#include <DDStreamer.h>
Public Member Functions | |
DDStreamer () | |
constructs a streamer object with yet undefined std::istream and std::ostream More... | |
DDStreamer (std::istream &readFrom) | |
creates a streamer object for reading More... | |
DDStreamer (std::ostream &writeTo) | |
creates a streamer object for writing More... | |
void | read () |
populate DDD transient objects from the std::istream refetrred to by member i_ More... | |
void | read (std::istream &is) |
populate DDD transient objects from the given std::istream is More... | |
void | setInput (std::istream &i) |
set the istream for DDStreamer::read() More... | |
void | setOutput (std::ostream &o) |
set the std::ostream for DDStreamer::write() More... | |
void | write () |
stream all DDD transient objects to the std::ostream referred to by member o_ More... | |
void | write (std::ostream &os) |
stream all DDD transient objects to the given std::ostream os More... | |
virtual | ~DDStreamer () |
does nothing; usefull only if another streamer derives from DDStreamer More... | |
Protected Member Functions | |
void | materials_read () |
read all instances of DDMaterial More... | |
void | materials_write () |
write all instances of DDMaterial More... | |
void | names_read () |
read all instances of DDName More... | |
void | names_write () |
write all instances of DDName More... | |
void | parts_read () |
read all instances of DDLogicalPart More... | |
void | parts_write () |
write all instances of DDLogicalPart More... | |
void | pos_read () |
read the graph structure for DDCompactView::graph() More... | |
void | pos_write () |
write the graph structure of DDCompactView::graph() More... | |
void | rots_read () |
read all instances of DDRotation More... | |
void | rots_write () |
write all instances of DDRotation More... | |
void | solids_read () |
read all instances of DDSolid More... | |
void | solids_write () |
write all instances of DDSolid More... | |
void | specs_read () |
read all instances of More... | |
void | specs_write () |
write all instances of DDSpecifics More... | |
void | vars_read () |
read the dictionlary of ClhepEvaluator More... | |
void | vars_write () |
write the dictionary of ClhepEvaluator More... | |
Private Attributes | |
const DDCompactView * | cpv_ |
std::istream * | i_ |
std::ostream * | o_ |
Streaming the DDD transient store from/into a std::istream/std::ostream */.
DDStreamer can be used to write the DDD transient object into a std::ostram and to retrieve them again via an std::istream.
The streamer can also be used together with DDLParser. Once possible usage scenario would be to load most of the geometrical DDD information via the streamer and parse some addional DDD XML documents containing SpecPar-information using DDLParser.
If DDStreamer is used together with DDLParser, the user has to ensure that reading in via DDStreamer::read() is done BEFORE invoking DDLParser to guarantee internal consistensies of the DDD objects.
Definition at line 41 of file DDStreamer.h.
DDStreamer::DDStreamer | ( | ) |
constructs a streamer object with yet undefined std::istream and std::ostream
Definition at line 22 of file DDStreamer.cc.
DDStreamer::DDStreamer | ( | std::istream & | readFrom | ) |
DDStreamer::DDStreamer | ( | std::ostream & | writeTo | ) |
|
virtual |
does nothing; usefull only if another streamer derives from DDStreamer
Definition at line 49 of file DDStreamer.cc.
|
protected |
read all instances of DDMaterial
Definition at line 285 of file DDStreamer.cc.
References a, DDMaterial::addMaterial(), DCOUT, dd_get_name(), i, i_, j, m, n, DDBase< N, C >::name(), and detailsBasic3DVector::z.
Referenced by read().
|
protected |
write all instances of DDMaterial
Definition at line 256 of file DDStreamer.cc.
References DDMaterial::a(), DDBase< DDName, DDI::Material * >::begin(), DDMaterial::constituent(), DCOUT, dd_count(), DDMaterial::density(), DDBase< DDName, DDI::Material * >::end(), j, m, DDBase< N, C >::name(), nameout(), DDMaterial::noOfConstituents(), o_, and DDMaterial::z().
Referenced by write().
|
protected |
read all instances of DDName
Definition at line 190 of file DDStreamer.cc.
References DCOUT, dd_get_delimit(), DDName::defineId(), i, i_, DDI::Singleton< I >::instance(), and asciidump::s.
Referenced by read().
|
protected |
write all instances of DDName
Definition at line 171 of file DDStreamer.cc.
References prof2calltree::count, DCOUT, DDI::Singleton< I >::instance(), and o_.
Referenced by write().
|
protected |
read all instances of DDLogicalPart
Definition at line 514 of file DDStreamer.cc.
References DCOUT, dd_get_name(), i, i_, and n.
Referenced by read().
|
protected |
write all instances of DDLogicalPart
Definition at line 493 of file DDStreamer.cc.
References DDBase< DDName, DDI::LogicalPart * >::begin(), DDLogicalPart::category(), DCOUT, dd_count(), DDBase< DDName, DDI::LogicalPart * >::end(), DDLogicalPart::material(), DDBase< N, C >::name(), nameout(), o_, and DDLogicalPart::solid().
Referenced by write().
|
protected |
read the graph structure for DDCompactView::graph()
Definition at line 676 of file DDStreamer.cc.
References CommonMethods::cp(), DCOUT, dd_get_name(), dd_rot_bin_in(), DDanonymousRot(), Capri::details::from(), g, DDCompactView::graph(), i, i_, DDI::Singleton< I >::instance(), argparse::message, n, DDBase< N, C >::name(), DDCompactView::position(), dbtoconf::root, graph< N, E >::size(), matplotRender::t, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.
Referenced by read().
|
protected |
write the graph structure of DDCompactView::graph()
Definition at line 610 of file DDStreamer.cc.
References graph< N, E >::begin_iter(), prof2calltree::count, DCOUT, dd_rot_bin_out(), graph< N, E >::end_iter(), g, DDCompactView::graph(), DDI::Singleton< I >::instance(), DDBase< N, C >::name(), nameout(), and o_.
Referenced by write().
void DDStreamer::read | ( | ) |
populate DDD transient objects from the std::istream refetrred to by member i_
Definition at line 121 of file DDStreamer.cc.
References i_.
Referenced by python.Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and python.Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().
void DDStreamer::read | ( | std::istream & | is | ) |
populate DDD transient objects from the given std::istream is
Definition at line 154 of file DDStreamer.cc.
References i_, materials_read(), names_read(), parts_read(), pos_read(), rots_read(), solids_read(), specs_read(), and vars_read().
Referenced by python.Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and python.Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().
|
protected |
read all instances of DDRotation
Definition at line 587 of file DDStreamer.cc.
References trackerHits::c, DCOUT, dd_get_name(), dd_rot_bin_in(), i, i_, n, DDBase< N, C >::name(), and submit::rm.
Referenced by read().
|
protected |
write all instances of DDRotation
Definition at line 558 of file DDStreamer.cc.
References DDBase< DDName, DDRotationMatrix * >::begin(), DCOUT, dd_count(), dd_rot_out(), DDBase< DDName, DDRotationMatrix * >::end(), o_, and csvReporter::r.
Referenced by write().
|
inline |
|
inline |
set the std::ostream for DDStreamer::write()
Definition at line 72 of file DDStreamer.h.
References connectstrParser::o, and o_.
|
protected |
read all instances of DDSolid
Definition at line 406 of file DDStreamer.cc.
References a, b, trackerHits::c, DCOUT, dd_get_boolean_params(), dd_get_name(), ddbox, ddcons, ddintersection, ddpolycone_rrz, ddpolycone_rz, ddpolyhedra_rrz, ddpolyhedra_rz, ddpseudotrap, ddreflected, ddshapeless, ddsubtraction, ddtrap, ddtubs, ddunion, i, i_, DDSolidFactory::intersection(), n, L1TEmulatorMonitor_cff::p, csvReporter::r, DDSolidFactory::reflection(), DDSolidFactory::subtraction(), matplotRender::t, and DDSolidFactory::unionSolid().
Referenced by read().
|
protected |
write all instances of DDSolid
Definition at line 346 of file DDStreamer.cc.
References DDBase< DDName, DDI::Solid * >::begin(), DCOUT, dd_count(), dd_stream_booleans(), dd_stream_reflected(), ddintersection, ddreflected, ddsubtraction, ddunion, DDBase< DDName, DDI::Solid * >::end(), DDSolidShapesName::name(), DDBase< N, C >::name(), nameout(), o_, L1TEmulatorMonitor_cff::p, DDSolid::parameters(), asciidump::s, and DDSolid::shape().
Referenced by write().
|
protected |
read all instances of
Definition at line 824 of file DDStreamer.cc.
References DCOUT, dd_get_delimit(), dd_get_name(), i, i_, n, mergeVDriftHistosByStation::name, query::result, asciidump::s, DDValue::setEvalState(), and python.multivaluedict::sort().
Referenced by read().
|
protected |
write all instances of DDSpecifics
Definition at line 774 of file DDStreamer.cc.
References DDBase< DDName, DDI::Specific * >::begin(), DCOUT, dd_count(), DDBase< DDName, DDI::Specific * >::end(), i, DDValue::isEvaluated(), DDValue::name(), DDBase< N, C >::name(), nameout(), o_, asciidump::s, DDSpecifics::selection(), DDValue::size(), DDSpecifics::specifics(), DDValue::strings(), and v.
Referenced by write().
|
protected |
read the dictionlary of ClhepEvaluator
Definition at line 912 of file DDStreamer.cc.
References DDConstant::createConstantsFromEvaluator(), DCOUT, dd_get_delimit(), i, i_, DDI::Singleton< I >::instance(), n, mergeVDriftHistosByStation::name, ClhepEvaluator::set(), and relativeConstraints::value.
Referenced by read().
|
protected |
write the dictionary of ClhepEvaluator
Definition at line 888 of file DDStreamer.cc.
References i, DDI::Singleton< I >::instance(), o_, asciidump::s, ClhepEvaluator::values(), and ClhepEvaluator::variables().
Referenced by write().
void DDStreamer::write | ( | void | ) |
stream all DDD transient objects to the std::ostream referred to by member o_
Definition at line 111 of file DDStreamer.cc.
References o_.
void DDStreamer::write | ( | std::ostream & | os | ) |
stream all DDD transient objects to the given std::ostream os
Definition at line 131 of file DDStreamer.cc.
References materials_write(), names_write(), o_, parts_write(), pos_write(), rots_write(), solids_write(), specs_write(), and vars_write().
|
private |
not used
Definition at line 124 of file DDStreamer.h.
|
private |
istream target for reading DDD objects
Definition at line 126 of file DDStreamer.h.
Referenced by DDStreamer(), materials_read(), names_read(), parts_read(), pos_read(), read(), rots_read(), setInput(), solids_read(), specs_read(), and vars_read().
|
private |
std::ostream target for writing DDD objects
Definition at line 125 of file DDStreamer.h.
Referenced by DDStreamer(), materials_write(), names_write(), parts_write(), pos_write(), rots_write(), setOutput(), solids_write(), specs_write(), vars_write(), and write().