-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Projekt-zespolowy-TIU/dev
Version 0.0.2 alpha
- Loading branch information
Showing
54 changed files
with
1,194 additions
and
882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "Host.h" | ||
|
||
namespace core { | ||
Host::Host(std::unique_ptr<IPaddress> ip, const QString& name, const cpp_int& id): | ||
_Ip{std::move(ip)}, | ||
_Name{name}, | ||
_Id{id} | ||
{} | ||
|
||
const IPaddress& Host::Ip() const | ||
{ | ||
return *_Ip; | ||
} | ||
|
||
QString Host::Name() const | ||
{ | ||
return _Name; | ||
} | ||
|
||
boost::multiprecision::cpp_int Host::Id() const | ||
{ | ||
return _Id; | ||
} | ||
|
||
void Host::Ip(std::unique_ptr<IPaddress> ip) | ||
{ | ||
_Ip = std::move(ip); | ||
} | ||
|
||
void Host::Name(const QString& name) | ||
{ | ||
_Name = name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
#ifndef HOST_H | ||
#define HOSTH | ||
|
||
#include <memory> | ||
#include <QString> | ||
#include <boost/multiprecision/cpp_int.hpp> | ||
|
||
#include "IPaddress.h" | ||
|
||
namespace core { | ||
using boost::multiprecision::cpp_int; | ||
|
||
class Host final | ||
{ | ||
public: | ||
Host(std::unique_ptr<IPaddress> ip, const QString& name, const cpp_int& id); | ||
|
||
const IPaddress& Ip() const; | ||
QString Name() const; | ||
cpp_int Id() const; | ||
|
||
void Ip(std::unique_ptr<IPaddress> ip); | ||
void Name(const QString& name); | ||
private: | ||
std::unique_ptr<IPaddress> _Ip; | ||
QString _Name; | ||
cpp_int _Id; | ||
}; | ||
}; | ||
|
||
#endif // HOST_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
#ifndef IIPADDRPRINTABLE_H | ||
#define IIPADDRPRINTABLE_H | ||
|
||
#include <QString> | ||
|
||
namespace core{ | ||
class IIPaddrPrintable | ||
{ | ||
public: | ||
virtual QString asStringDec() const = 0; | ||
virtual QString asStringBin() const = 0; | ||
|
||
//~~~~~~~~~~~~~~~~INTERFACE OVERHEAD~~~~~~~~~~~~~~~~// | ||
public: | ||
virtual ~IIPaddrPrintable() = default; | ||
protected: | ||
IIPaddrPrintable() = default; | ||
IIPaddrPrintable(const IIPaddrPrintable&) = default; | ||
IIPaddrPrintable& operator=(const IIPaddrPrintable&) = default; | ||
IIPaddrPrintable(IIPaddrPrintable&&) noexcept = default; | ||
IIPaddrPrintable& operator=(IIPaddrPrintable&&) noexcept = default; | ||
//~~~~~~~~~~~~~~~~INTERFACE OVERHEAD~~~~~~~~~~~~~~~~// | ||
}; | ||
}; | ||
|
||
#endif // IIPADDRPRINTABLE_H |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
#ifndef INETWORK_H | ||
#define INETWORK_H | ||
|
||
#include <vector> | ||
#include <QString> | ||
#include <boost/multiprecision/cpp_int.hpp> | ||
|
||
#include "IPaddress.h" | ||
#include "ISubnet.h" | ||
|
||
namespace core { | ||
using boost::multiprecision::cpp_int; | ||
|
||
class INetwork | ||
{ | ||
public: | ||
virtual const IPaddress& Ip() const = 0; | ||
virtual const IPaddress& Mask() const = 0; | ||
virtual const std::vector<std::shared_ptr<ISubnet>>& Subnets() const = 0; | ||
|
||
virtual void Subnets(const std::vector<std::shared_ptr<ISubnet>>& subnets) = 0; | ||
|
||
virtual void addSubnet(const cpp_int& hostNumber, const QString& name) = 0; | ||
|
||
virtual cpp_int hostsCapacity() const = 0; | ||
virtual bool isSubnet(const IPaddress& hostIP) const = 0; | ||
|
||
//~~~~~~~~~~~~~~~~INTERFACE OVERHEAD~~~~~~~~~~~~~~~~// | ||
public: | ||
virtual ~INetwork() = default; | ||
protected: | ||
INetwork() = default; | ||
INetwork(const INetwork&) = default; | ||
INetwork& operator=(const INetwork&) = default; | ||
INetwork(INetwork&&) noexcept = default; | ||
INetwork& operator=(INetwork&&) noexcept = default; | ||
}; | ||
//~~~~~~~~~~~~~~~~INTERFACE OVERHEAD~~~~~~~~~~~~~~~~// | ||
} | ||
|
||
#endif // INETWORK_H |
Oops, something went wrong.