LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
lqnx_io.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012-2026, QORE Lab, Imperial College London
3
* All rights reserved.
4
*/
5
#ifndef LINE_IO_LQNX_IO_H
6
#define LINE_IO_LQNX_IO_H
7
8
/**
9
* @file
10
* @ingroup line_io
11
* The `.lqnx` (LQNS XML) interchange as a symmetric MODEL-LEVEL pair in `io::`.
12
*
13
* The implementations live in `lang/lqn/`: `lqn::read_lqnx_model` returns the
14
* `LqnModel` a builder produces, `lqn::write_lqnx` takes one, and
15
* `lqn::read_lqnx` returns the FINALIZED `LqnStruct` SolverLN consumes. The
16
* struct reader is the odd one out of that trio: its output cannot be handed
17
* back to the writer. So the io pair is `read_lqnx_model` / `write_lqnx`,
18
* both on `LqnModel`, keeping the `lqn::` names verbatim so a caller moving
19
* between the namespaces meets no second spelling. MATLAB spells the same pair
20
* `LayeredNetwork.parseXML` / `writeXML`, which name methods of a class this
21
* port does not have.
22
*/
23
24
#include <string>
25
26
#include "
line/lang/lqn/lqn_reader.h
"
27
#include "
line/lang/lqn/lqn_writer.h
"
28
29
namespace
line
{
30
namespace
io
{
31
32
/** Read a `.lqnx` file into the model-level `LqnModel`, which `write_lqnx` accepts back. */
33
template
<
class
T>
34
lqn::LqnModel<T>
read_lqnx_model
(
const
std::string& path) {
35
return
lqn::read_lqnx_model<T>
(path);
36
}
37
38
/**
39
* Write an `LqnModel` as `.lqnx`; forwards to `lqn::write_lqnx`.
40
*
41
* @return what the schema could not carry (see `lqn::LqnWriteReport`)
42
*/
43
template
<
class
T>
44
lqn::LqnWriteReport
write_lqnx
(
const
lqn::LqnModel<T>
& m,
const
std::string& path,
45
const
std::string& model_name = std::string(
"LQN"
),
46
bool
use_abstract_names =
false
, std::string* out_text = NULL) {
47
return
lqn::write_lqnx
(m, path, model_name, use_abstract_names, out_text);
48
}
49
50
}
// namespace io
51
}
// namespace line
52
53
#endif
// LINE_IO_LQNX_IO_H
lqn_reader.h
.lqnx -> LqnStruct, a port of matlab/src/lang/layered/@LayeredNetwork/parseXML.m followed by ....
lqn_writer.h
LqnModel -> .lqnx, a port of matlab/src/lang/layered/@LayeredNetwork/writeXML.m.
line::io
Definition
code_gen.h:68
line::io::read_lqnx_model
lqn::LqnModel< T > read_lqnx_model(const std::string &path)
Read a .lqnx file into the model-level LqnModel, which write_lqnx accepts back.
Definition
lqnx_io.h:34
line::io::write_lqnx
lqn::LqnWriteReport 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.
Definition
lqnx_io.h:44
line::lqn::read_lqnx_model
LqnModel< T > read_lqnx_model(const std::string &path)
Definition
lqn_reader.h:1336
line::lqn::write_lqnx
LqnWriteReport write_lqnx(const 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 a layered model as a .lqnx document.
Definition
lqn_writer.h:219
line
Conservation laws of a layered queueing network, enumerated from its structure.
Definition
aoi_dist2ph.h:52
line::lqn::LqnModel
The intermediate model, and the second stage that flattens it.
Definition
lqn_reader.h:409
line::lqn::LqnWriteReport
What the schema could not carry, one human-readable line per loss.
Definition
lqn_writer.h:66
include
line
io
lqnx_io.h
Generated by
1.18.0