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

The FIELD VIEW the NetworkStruct contract is checked on: for each value, its kind (Matrix, vector, map, scalar, string, function, opaque), whether it is empty, and its extents, so a contract written in MATLAB's dimensions (M stations, K classes, ...) can be checked against a struct that is object- shaped. More...

#include <cstddef>
#include <functional>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "line/lang/qn/network_struct.h"
#include "line/util/matrix.h"
Include dependency graph for sn_field_view.h:

Go to the source code of this file.

Classes

struct  line::api::SnFieldView
 The view of one field. More...
struct  line::api::SnFieldViews
 The view of a whole struct: its dimensions and one view per contract field, by MATLAB name. More...

Namespaces

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

Functions

long line::api::sn_view_extent (const SnFieldView &v)
 The 1-D extent of a field view: a container's size, a vector Matrix's length.
template<class X>
SnFieldView line::api::sn_field_view (const X &x)
 The view of one value; the kind follows its C++ type.
template<class R, class F>
SnFieldView line::api::sn_field_rows (const std::vector< R > &records, F member)
 One field made of a member of every record (Station, JobClass, NodeDef), in record order.
template<class T>
std::map< char, double > line::api::sn_contract_dims (const qn::NetworkStruct< T > &sn)
 The dimensions the contract's shapes are written in.

Variables

constexpr long line::api::kNoExtent = -1
constexpr long line::api::kEmptyExtent = -2

Detailed Description

The FIELD VIEW the NetworkStruct contract is checked on: for each value, its kind (Matrix, vector, map, scalar, string, function, opaque), whether it is empty, and its extents, so a contract written in MATLAB's dimensions (M stations, K classes, ...) can be checked against a struct that is object- shaped.

sn_contract.h (generated) builds the view of a whole struct; this header holds the hand-written sn_field_view overloads it calls and the aggregation sn_field_rows that turns a member of every Station, JobClass or NodeDef record into one per-record field.

Extents: a Matrix has rows x cols; a container has its size, and records the 1-D extent of each element (a container's size, a vector Matrix's length), kEmptyExtent for an empty element and kNoExtent for one with no 1-D extent (a scalar, a 2-D Matrix).

Definition in file sn_field_view.h.