42 lines
754 B
C++
42 lines
754 B
C++
|
#include "route.h"
|
||
|
|
||
|
using namespace Core;
|
||
|
|
||
|
Route::Route()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
Route::Route(const Route &other)
|
||
|
: links_store(other.links_store) {}
|
||
|
|
||
|
QStringList Route::links() const
|
||
|
{
|
||
|
return links_store;
|
||
|
}
|
||
|
|
||
|
Route Route::operator |(const QString &node) const
|
||
|
{
|
||
|
Route exlink(*this);
|
||
|
exlink.links_store.append(node);
|
||
|
return exlink;
|
||
|
}
|
||
|
|
||
|
bool Route::operator==(const Route &other) const
|
||
|
{
|
||
|
if(links_store.size() == other.links_store.size()){
|
||
|
for(auto idx=0; idx<links_store.size(); ++idx)
|
||
|
if(links_store.at(idx) != other.links_store.at(idx))
|
||
|
return false;
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
Route Route::collect(const QList<QString> &list)
|
||
|
{
|
||
|
Route v;
|
||
|
v.links_store.append(list);
|
||
|
return v;
|
||
|
}
|