#include <XMLHepRepWriter.h>
Definition at line 38 of file XMLHepRepWriter.h.
◆ XMLHepRepWriter()
cheprep::XMLHepRepWriter::XMLHepRepWriter |
( |
std::ostream * |
out, |
|
|
bool |
randomAccess, |
|
|
bool |
compress |
|
) |
| |
Definition at line 21 of file XMLHepRepWriter.cc.
29 zip =
new ZipOutputStream(*os);
35 #ifndef CHEPREP_NO_ZLIB 36 gz =
new GZIPOutputStream(*os);
39 cerr <<
"WARNING: the .gz output stream you are creating will be a plain file," << endl;
40 cerr <<
"since compression support (ZLIB) was not compiled into the library." << endl;
41 cerr <<
"To add ZLIB support, you need to undefine CHEPREP_NO_ZLIB." << endl;
cheprep::ZipOutputStream * zip
cheprep::GZIPOutputStream * gz
◆ ~XMLHepRepWriter()
cheprep::XMLHepRepWriter::~XMLHepRepWriter |
( |
| ) |
|
Definition at line 50 of file XMLHepRepWriter.cc.
cheprep::ZipOutputStream * zip
cheprep::GZIPOutputStream * gz
◆ addProperty()
bool cheprep::XMLHepRepWriter::addProperty |
( |
std::string |
key, |
|
|
std::string |
value |
|
) |
| |
|
virtual |
◆ close()
bool cheprep::XMLHepRepWriter::close |
( |
| ) |
|
|
virtual |
Implements HEPREP::HepRepWriter.
Definition at line 60 of file XMLHepRepWriter.cc.
64 map<string, string>::iterator i =
properties.begin();
66 *
zip << (*i).first <<
"=" << (*i).second << endl;
std::map< std::string, std::string > properties
cheprep::ZipOutputStream * zip
void putNextEntry(const std::string &name, bool compress)
cheprep::GZIPOutputStream * gz
◆ write() [1/13]
bool cheprep::XMLHepRepWriter::write |
( |
HEPREP::HepRep * |
heprep, |
|
|
std::string |
name |
|
) |
| |
|
virtual |
Implements HEPREP::HepRepWriter.
Definition at line 79 of file XMLHepRepWriter.cc.
84 if (
name.rfind(
".bheprep") ==
name.length()-8) {
85 xml =
new BHepRepWriter(*
out);
92 xml->
setAttribute(
"xmlns", (
string)
"http://java.freehep.org/schemas/heprep/2.0");
93 xml->
setAttribute(
"xmlns",
"xsi",
"http://www.w3.org/2001/XMLSchema-instance");
94 xml->
setAttribute(
"xsi",
"schemaLocation",
"http://java.freehep.org/schemas/heprep/2.0 http://java.freehep.org/schemas/heprep/2.0/HepRep.xsd");
98 for (vector<HepRepTypeTree*>::iterator i1=typeTreeSet.begin(); i1 != typeTreeSet.end(); i1++) {
102 for (vector<HepRepInstanceTree*>::iterator i2=instanceTreeSet.begin(); i2 != instanceTreeSet.end(); i2++) {
virtual void openTag(std::string ns, std::string name)=0
cheprep::ZipOutputStream * zip
virtual std::vector< HepRepTypeTree * > getTypeTreeList()=0
void putNextEntry(const std::string &name, bool compress)
virtual void closeTag()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual void closeDoc(bool force=false)=0
virtual void openDoc(std::string version="1.0", std::string encoding="", bool standalone=false)=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::vector< std::string > getLayerOrder()=0
virtual std::vector< HepRepInstanceTree * > getInstanceTreeList()=0
◆ write() [2/13]
bool cheprep::XMLHepRepWriter::write |
( |
std::vector< std::string > |
layers | ) |
|
|
virtual |
Implements HEPREP::HepRepWriter.
Definition at line 117 of file XMLHepRepWriter.cc.
118 string layerOrder =
"";
120 for (vector<string>::iterator i=layers.begin(); i != layers.end(); i++) {
122 layerOrder.append(
", ");
124 layerOrder.append(*i);
virtual void printTag(std::string ns, std::string name)=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
◆ write() [3/13]
Implements HEPREP::HepRepWriter.
Definition at line 132 of file XMLHepRepWriter.cc.
137 vector<HepRepType*> types = typeTree->
getTypeList();
138 for (vector<HepRepType*>::iterator i=types.begin(); i != types.end(); i++) {
virtual void openTag(std::string ns, std::string name)=0
virtual std::string getName()=0
virtual void closeTag()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::string getVersion()=0
virtual std::vector< HepRepType * > getTypeList()=0
◆ write() [4/13]
Implements HEPREP::HepRepWriter.
Definition at line 146 of file XMLHepRepWriter.cc.
153 for (vector<HepRepType*>::iterator i=types.begin(); i != types.end(); i++) {
virtual void openTag(std::string ns, std::string name)=0
virtual void closeTag()=0
virtual std::vector< HepRepType * > getTypeList()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual std::string getName()=0
bool write(HEPREP::HepRep *heprep, std::string name)
◆ write() [5/13]
Implements HEPREP::HepRepWriter.
Definition at line 160 of file XMLHepRepWriter.cc.
virtual std::string getName()=0
virtual void printTag(std::string ns, std::string name)=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual std::string getQualifier()=0
virtual std::string getVersion()=0
◆ write() [6/13]
Implements HEPREP::HepRepWriter.
Definition at line 168 of file XMLHepRepWriter.cc.
virtual std::string getExpression()=0
virtual std::string getName()=0
virtual void printTag(std::string ns, std::string name)=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
◆ write() [7/13]
Implements HEPREP::HepRepWriter.
Definition at line 175 of file XMLHepRepWriter.cc.
183 for (vector<HepRepTreeID*>::iterator i1=instanceTreeSet.begin(); i1 != instanceTreeSet.end(); i1++) {
188 vector<HepRepInstance*> instanceList = instanceTree->
getInstances();
189 for (vector<HepRepInstance*>::iterator i2=instanceList.begin(); i2 != instanceList.end(); i2++) {
virtual void openTag(std::string ns, std::string name)=0
virtual std::string getName()=0
virtual HepRepTreeID * getTypeTree()=0
virtual void closeTag()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual std::vector< HepRepInstance * > getInstances()=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::string getVersion()=0
virtual std::vector< HepRepTreeID * > getInstanceTreeList()=0
◆ write() [8/13]
Implements HEPREP::HepRepWriter.
Definition at line 196 of file XMLHepRepWriter.cc.
202 vector<HepRepPoint*> pointList = instance->
getPoints();
203 for (vector<HepRepPoint*>::iterator i1=pointList.begin(); i1 != pointList.end(); i1++) {
207 vector<HepRepInstance*> instanceList = instance->
getInstances();
208 for (vector<HepRepInstance*>::iterator i2=instanceList.begin(); i2 != instanceList.end(); i2++) {
virtual void openTag(std::string ns, std::string name)=0
virtual std::vector< HepRepInstance * > getInstances()=0
virtual std::vector< HepRepPoint * > getPoints()=0
virtual void closeTag()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual HepRepType * getType()=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::string getFullName()=0
◆ write() [9/13]
Implements HEPREP::HepRepWriter.
Definition at line 215 of file XMLHepRepWriter.cc.
virtual void openTag(std::string ns, std::string name)=0
virtual void printTag(std::string ns, std::string name)=0
virtual void closeTag()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::set< HepRepAttValue * > getAttValuesFromNode()=0
◆ write() [10/13]
Implements HEPREP::HepRepWriter.
Definition at line 229 of file XMLHepRepWriter.cc.
233 if (layerAtt != NULL)
write(layerAtt);
236 for (set<HepRepAttValue*>::iterator i=attSet.begin(); i != attSet.end(); i++) {
virtual HepRepAttValue * getAttValueFromNode(std::string lowerCaseName)=0
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::set< HepRepAttValue * > getAttValuesFromNode()=0
◆ write() [11/13]
Implements HEPREP::HepRepWriter.
Definition at line 242 of file XMLHepRepWriter.cc.
244 for (set<HepRepAttDef*>::iterator i=list.begin(); i != list.end(); i++) {
bool write(HEPREP::HepRep *heprep, std::string name)
virtual std::set< HepRepAttDef * > getAttDefsFromNode()=0
◆ write() [12/13]
Implements HEPREP::HepRepWriter.
Definition at line 250 of file XMLHepRepWriter.cc.
271 if (attValue->
showLabel() != HepRepConstants::SHOW_NONE) {
virtual std::string getAsString()=0
virtual std::string getString()=0
virtual void printTag(std::string ns, std::string name)=0
virtual std::vector< double > getColor()=0
virtual int showLabel()=0
virtual double getDouble()=0
virtual int getInteger()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual int64 getLong()=0
virtual bool getBoolean()=0
virtual std::string getName()=0
◆ write() [13/13]
Implements HEPREP::HepRepWriter.
Definition at line 279 of file XMLHepRepWriter.cc.
virtual std::string getName()=0
virtual std::string getExtra()=0
virtual void printTag(std::string ns, std::string name)=0
virtual std::string getCategory()=0
virtual void setAttribute(std::string ns, std::string name, std::string value)=0
virtual std::string getDescription()=0
◆ compress
bool cheprep::XMLHepRepWriter::compress |
|
private |
◆ gz
◆ nameSpace
std::string cheprep::XMLHepRepWriter::nameSpace |
|
private |
◆ out
std::ostream* cheprep::XMLHepRepWriter::out |
|
private |
◆ properties
std::map<std::string, std::string> cheprep::XMLHepRepWriter::properties |
|
private |
◆ xml
◆ zip
The documentation for this class was generated from the following files: