#include <XMLHepRepWriter.h>
Definition at line 38 of file XMLHepRepWriter.h.
cheprep::XMLHepRepWriter::XMLHepRepWriter |
( |
std::ostream * |
out, |
|
|
bool |
randomAccess, |
|
|
bool |
compress |
|
) |
| |
Definition at line 21 of file XMLHepRepWriter.cc.
23 compress(useCompression),
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::XMLHepRepWriter::~XMLHepRepWriter |
( |
| ) |
|
bool cheprep::XMLHepRepWriter::addProperty |
( |
std::string |
key, |
|
|
std::string |
value |
|
) |
| |
|
virtual |
Adds a property, to be written to the HepRep file when closed.
- Parameters
-
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 55 of file XMLHepRepWriter.cc.
56 properties[key] =
value;
const XML_Char int const XML_Char * value
bool cheprep::XMLHepRepWriter::close |
( |
| ) |
|
|
virtual |
Closes the writer and its underlying stream.
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 60 of file XMLHepRepWriter.cc.
64 map<string, string>::iterator i = properties.begin();
65 while (i != properties.end()) {
66 *zip << (*i).first <<
"=" << (*i).second << endl;
void putNextEntry(const std::string &name, bool compress)
bool cheprep::XMLHepRepWriter::write |
( |
HEPREP::HepRep * |
heprep, |
|
|
std::string |
name |
|
) |
| |
|
virtual |
Writes a HepRep.
- Parameters
-
heprep | to be written. |
name | for the heprep to be written (for tagged access), may be ommited. |
- Returns
- false in case of a stream problem.
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");
95 xml->
openTag(nameSpace,
"heprep");
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
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
bool cheprep::XMLHepRepWriter::write |
( |
std::vector< std::string > |
layerOrder | ) |
|
|
virtual |
Writes the layerOrder.
- Parameters
-
- Returns
- false in case of a stream problem.
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
Writes a HepRepTypeTree.
- Parameters
-
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 132 of file XMLHepRepWriter.cc.
135 xml->
openTag(nameSpace,
"typetree");
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
Writes a HepRepType.
- Parameters
-
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 146 of file XMLHepRepWriter.cc.
148 xml->
openTag(nameSpace,
"type");
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)
Writes a HepRepTreeID.
- Parameters
-
- Returns
- false in case of a stream problem.
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
Writes a HepRepAction.
- Parameters
-
- Returns
- false in case of a stream problem.
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
Writes a HepRepInstanceTree.
- Parameters
-
instanceTree | to be written. |
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 175 of file XMLHepRepWriter.cc.
180 xml->
openTag(nameSpace,
"instancetree");
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
Writes a HepRepInstance.
- Parameters
-
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 196 of file XMLHepRepWriter.cc.
199 xml->
openTag(nameSpace,
"instance");
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
Writes a HepRepPoint.
- Parameters
-
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 215 of file XMLHepRepWriter.cc.
220 xml->
openTag(nameSpace,
"point");
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
Writes a HepRepAttribute.
- Parameters
-
- Returns
- false in case of a stream problem.
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
Writes a HepRepDefinition.
- Parameters
-
- Returns
- false in case of a stream problem.
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
Writes a HepRepAttValue.
- Parameters
-
- Returns
- false in case of a stream problem.
Implements HEPREP::HepRepWriter.
Definition at line 250 of file XMLHepRepWriter.cc.
271 if (attValue->
showLabel() != HepRepConstants::SHOW_NONE) {
275 xml->
printTag(nameSpace,
"attvalue");
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
Writes a HepRepAttDef.
- Parameters
-
- Returns
- false in case of a stream problem.
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
The documentation for this class was generated from the following files: