CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DDStreamer Class Reference

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

std::istream * i_
 
std::ostream * o_
 

Detailed Description

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.



// writing:
#include<fstream>
std::ofstream file("pers.txt");
DDStreamer streamer(file);
streamer.write();
// reading:
#include<fstream>
std::ifstream file("pers.txt");
DDStreamer streamer(filer);
streamer.read();

Definition at line 41 of file DDStreamer.h.

Constructor & Destructor Documentation

DDStreamer::DDStreamer ( )

constructs a streamer object with yet undefined std::istream and std::ostream

Definition at line 21 of file DDStreamer.cc.

DDStreamer::DDStreamer ( std::istream &  readFrom)

creates a streamer object for reading

Definition at line 37 of file DDStreamer.cc.

DDStreamer::DDStreamer ( std::ostream &  writeTo)

creates a streamer object for writing

Definition at line 26 of file DDStreamer.cc.

DDStreamer::~DDStreamer ( )
virtual

does nothing; usefull only if another streamer derives from DDStreamer

Definition at line 48 of file DDStreamer.cc.

Member Function Documentation

void DDStreamer::materials_read ( )
protected

read all instances of DDMaterial

Definition at line 284 of file DDStreamer.cc.

void DDStreamer::materials_write ( )
protected

write all instances of DDMaterial

Definition at line 255 of file DDStreamer.cc.

void DDStreamer::names_read ( )
protected

read all instances of DDName

Definition at line 189 of file DDStreamer.cc.

void DDStreamer::names_write ( )
protected

write all instances of DDName

Definition at line 170 of file DDStreamer.cc.

void DDStreamer::parts_read ( )
protected

read all instances of DDLogicalPart

Definition at line 513 of file DDStreamer.cc.

void DDStreamer::parts_write ( )
protected

write all instances of DDLogicalPart

Definition at line 492 of file DDStreamer.cc.

void DDStreamer::pos_read ( )
protected

read the graph structure for DDCompactView::graph()

Definition at line 675 of file DDStreamer.cc.

void DDStreamer::pos_write ( )
protected

write the graph structure of DDCompactView::graph()

Definition at line 609 of file DDStreamer.cc.

void DDStreamer::read ( )

populate DDD transient objects from the std::istream refetrred to by member i_

Definition at line 120 of file DDStreamer.cc.

void DDStreamer::read ( std::istream &  is)

populate DDD transient objects from the given std::istream is

Definition at line 153 of file DDStreamer.cc.

void DDStreamer::rots_read ( )
protected

read all instances of DDRotation

Definition at line 586 of file DDStreamer.cc.

void DDStreamer::rots_write ( )
protected

write all instances of DDRotation

Definition at line 557 of file DDStreamer.cc.

void DDStreamer::setInput ( std::istream &  i)
inline

set the istream for DDStreamer::read()

Definition at line 69 of file DDStreamer.h.

References i, and i_.

69 { i_ = &i; }
int i
Definition: DBlmapReader.cc:9
std::istream * i_
Definition: DDStreamer.h:125
void DDStreamer::setOutput ( std::ostream &  o)
inline

set the std::ostream for DDStreamer::write()

Definition at line 72 of file DDStreamer.h.

References connectstrParser::o, and o_.

72 { o_ = &o; }
std::ostream * o_
Definition: DDStreamer.h:124
void DDStreamer::solids_read ( )
protected

read all instances of DDSolid

Definition at line 405 of file DDStreamer.cc.

void DDStreamer::solids_write ( )
protected

write all instances of DDSolid

Definition at line 345 of file DDStreamer.cc.

void DDStreamer::specs_read ( )
protected

read all instances of

Definition at line 823 of file DDStreamer.cc.

void DDStreamer::specs_write ( )
protected

write all instances of DDSpecifics

Definition at line 773 of file DDStreamer.cc.

void DDStreamer::vars_read ( )
protected

read the dictionlary of ClhepEvaluator

Definition at line 911 of file DDStreamer.cc.

void DDStreamer::vars_write ( )
protected

write the dictionary of ClhepEvaluator

Definition at line 887 of file DDStreamer.cc.

void DDStreamer::write ( )

stream all DDD transient objects to the std::ostream referred to by member o_

Definition at line 110 of file DDStreamer.cc.

void DDStreamer::write ( std::ostream &  os)

stream all DDD transient objects to the given std::ostream os

Definition at line 130 of file DDStreamer.cc.

Member Data Documentation

std::istream* DDStreamer::i_
private

istream target for reading DDD objects

Definition at line 125 of file DDStreamer.h.

Referenced by setInput().

std::ostream* DDStreamer::o_
private

std::ostream target for writing DDD objects

Definition at line 124 of file DDStreamer.h.

Referenced by setOutput().