2013-12-11 22:13:46 +00:00
|
|
|
/*
|
|
|
|
* File: TransNetwork.cpp
|
|
|
|
* Author: cmosher
|
|
|
|
*
|
|
|
|
* Created on December 11, 2013, 10:44 AM
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "TransNetwork.h"
|
|
|
|
#include "trans.h"
|
2013-12-12 13:37:45 +00:00
|
|
|
#include <memory>
|
2013-12-11 22:13:46 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
2013-12-12 13:37:45 +00:00
|
|
|
TransNetwork::TransNetwork(std::istream& in) {
|
2013-12-11 22:13:46 +00:00
|
|
|
std::string c1, gate, c2;
|
2013-12-12 13:37:45 +00:00
|
|
|
in >> c1 >> gate >> c2;
|
|
|
|
while (in.good()) {
|
|
|
|
this->transes.insert(std::make_shared<Trans>(this->segs.getOrAdd(c1), this->segs.getOrAdd(gate), this->segs.getOrAdd(c2)));
|
|
|
|
in >> c1 >> gate >> c2;
|
2013-12-11 22:13:46 +00:00
|
|
|
}
|
2013-12-12 22:05:33 +00:00
|
|
|
|
|
|
|
this->segs.initCommon();
|
2013-12-11 22:13:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TransNetwork::~TransNetwork() {
|
|
|
|
}
|