LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
lqnx_io.h File Reference

The .lqnx (LQNS XML) interchange as a symmetric MODEL-LEVEL pair in io::. More...

Include dependency graph for lqnx_io.h:

Go to the source code of this file.

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::io

Functions

template<class T>
lqn::LqnModel< T > line::io::read_lqnx_model (const std::string &path)
 Read a .lqnx file into the model-level LqnModel, which write_lqnx accepts back.
template<class T>
lqn::LqnWriteReport line::io::write_lqnx (const lqn::LqnModel< T > &m, const std::string &path, const std::string &model_name=std::string("LQN"), bool use_abstract_names=false, std::string *out_text=NULL)
 Write an LqnModel as .lqnx; forwards to lqn::write_lqnx.
template<class T>
lqn::LqnModel< T > line::io::read_srvn_model (const std::string &path)
 Read an SRVN file (the LQNS .in text grammar, or a .lqn that is not XML) into the model-level LqnModel; forwards to lqn::read_srvn_model.
std::string line::io::srvn2lqnx (const std::string &src, const std::string &name=std::string("model"))
 Translate SRVN text into a .lqnx document; forwards to lqn::srvn2lqnx.
std::string line::io::lqnx2srvn (const std::string &xml_text, const std::string &name=std::string())
 Translate a .lqnx document into SRVN text; forwards to lqn::lqnx2srvn.
template<class T>
void line::io::write_srvn (const lqn::LqnModel< T > &m, const std::string &path, bool use_abstract_names=false)
 Write an LqnModel as SRVN text (write_lqnx, then lqnx2srvn); forwards to lqn::write_srvn.

Detailed Description

The .lqnx (LQNS XML) interchange as a symmetric MODEL-LEVEL pair in io::.

The implementations live in lang/lqn/: lqn::read_lqnx_model returns the LqnModel a builder produces, lqn::write_lqnx takes one, and lqn::read_lqnx returns the FINALIZED LqnStruct SolverLN consumes. The struct reader is the odd one out of that trio: its output cannot be handed back to the writer. So the io pair is read_lqnx_model / write_lqnx, both on LqnModel, keeping the lqn:: names verbatim so a caller moving between the namespaces meets no second spelling. MATLAB spells the same pair LayeredNetwork.parseXML / writeXML, which name methods of a class this port does not have.

The SRVN text grammar (.in) goes through this XML both ways: read_srvn_model / srvn2lqnx read it, write_srvn / lqnx2srvn write it, keeping the lqn:: names.

Definition in file lqnx_io.h.