NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
readwritenetwork.h
Go to the documentation of this file.
1
17#ifndef NeTrainSim_ReadWriteNetwork_h
18#define NeTrainSim_ReadWriteNetwork_h
19
20#include <iostream>
21#include <fstream>
22#include "netlink.h"
23#include "netnode.h"
24#include "../util/vector.h"
25#include <exception>
26
28
37Vector<std::tuple<int, double, double, std::string,
38 double, double>> readNodesFile(const std::string& fileName);
39
46bool writeNodesFile(Vector<std::tuple<int, double, double,
47 std::string, double,
48 double>> nodesRecords,
49 std::string& filename);
50
59Vector<std::tuple<int, int, int, double, int, double,
60 double, int, double, bool, string,
61 string, double> > readLinksFile(const std::string& fileName);
62
69bool writeLinksFile(Vector<std::tuple<int, int, int, double, int,
70 double, double, int, double,
71 bool, string, string,
72 double> > linksRecords,
73 std::string& filename);
74
81 Vector<std::tuple<int, double, double,
82 std::string, double, double>> nodesRecords);
83
90Vector<std::shared_ptr<NetLink>> generateLinks(Vector<std::shared_ptr<NetNode>> theFileNodes,
91 Vector<std::tuple<int, int, int, double, int, double, double, int, double, bool, string, string, double> > linksRecords);
92
101std::shared_ptr<NetNode> getSimulatorNodeByUserID(
102 Vector<std::shared_ptr<NetNode>> theFileNodes, int oldID);
103
104} // namespace ReadWriteNetwork
105
106#endif // NeTrainSim_ReadWriteNetwork_h
A vector.
Definition vector.h:24
Definition readwritenetwork.h:27
bool writeNodesFile(Vector< std::tuple< int, double, double, std::string, double, double > > nodesRecords, std::string &filename)
Writes the nodes file.
Vector< std::tuple< int, double, double, std::string, double, double > > readNodesFile(const std::string &fileName)
Reads the nodes file.
Definition readwritenetwork.cpp:24
Vector< std::shared_ptr< NetLink > > generateLinks(Vector< std::shared_ptr< NetNode > > theFileNodes, Vector< std::tuple< int, int, int, double, int, double, double, int, double, bool, string, string, double > > linksRecords)
Generates NetLink objects from the nodes and links records.
Vector< std::tuple< int, int, int, double, int, double, double, int, double, bool, string, string, double > > readLinksFile(const std::string &fileName)
Reads the links file.
Definition readwritenetwork.cpp:134
Vector< std::shared_ptr< NetNode > > generateNodes(Vector< std::tuple< int, double, double, std::string, double, double > > nodesRecords)
Generates NetNode objects from the nodes records.
Definition readwritenetwork.cpp:266
std::shared_ptr< NetNode > getSimulatorNodeByUserID(Vector< std::shared_ptr< NetNode > > theFileNodes, int oldID)
Gets the NetNode object with the given user identifier.
Definition readwritenetwork.cpp:334
bool writeLinksFile(Vector< std::tuple< int, int, int, double, int, double, double, int, double, bool, string, string, double > > linksRecords, std::string &filename)
Writes the links file.
This file contains the declaration of the NetNode class.