refactoring. Everything is pointer.
This commit is contained in:
@@ -4,27 +4,31 @@
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
#include "system/connect.hpp"
|
||||
#include "system/parts.hpp"
|
||||
#include "system/signals.hpp"
|
||||
|
||||
class ImportBase
|
||||
{
|
||||
protected:
|
||||
Parts *prts;
|
||||
virtual void parse(std::fstream lines) = 0;
|
||||
Signals *sigs;
|
||||
std::fstream file_lines;
|
||||
public:
|
||||
ImportBase()
|
||||
ImportBase(std::string file_name) : file_lines(std::fstream(file_name))
|
||||
{
|
||||
prts = new Parts();
|
||||
}
|
||||
void load(std::string file_name) {
|
||||
std::ifstream file(file_name);
|
||||
|
||||
sigs = new Signals();
|
||||
};
|
||||
Parts *parts()
|
||||
virtual void parse() = 0;
|
||||
Parts * parts()
|
||||
{
|
||||
return prts;
|
||||
}
|
||||
Signals * signals()
|
||||
{
|
||||
return sigs;
|
||||
}
|
||||
virtual ~ImportBase() = default;
|
||||
};
|
||||
|
||||
#endif // _IMPORT_BASE_HPP_
|
||||
Reference in New Issue
Block a user