Skip to content

Implementation of Class factory#11

Open
gruszczrob wants to merge 3 commits into
mainfrom
classFactory
Open

Implementation of Class factory#11
gruszczrob wants to merge 3 commits into
mainfrom
classFactory

Conversation

@gruszczrob

Copy link
Copy Markdown
Owner

No description provided.

@ProrokWielki ProrokWielki left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a point in having this class. You are trying to make very retarded python from the c++.

Comment thread ClassFactory/ClassFactory.cpp Outdated
}

ClassFactory::ClassFactory() {
writeToLogs("Drawable Engine Factory created");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That log look wrong :P

Comment thread ClassFactory/ClassFactory.h Outdated
#include <unordered_map>
#include <vector>
#include <variant>
#include "../Logs/Logs.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative paths shall not be used

Comment thread ClassFactory/ClassFactory.h Outdated
#include <variant>
#include "../Logs/Logs.h"

using namespace std;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread ClassFactory/ClassFactory.h Outdated

class ClassFactory {
private:
shared_ptr<bool> isCorrect = make_shared<bool>(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it a shared_ptr and not just bool?

Comment thread ClassFactory/ClassFactory.tpp Outdated
T ClassFactory::getVar(const string& varName) {
if (!checkIfCorrect()) {
cout << "This class contains error, one of arguments in constructor was in incorrect type" << endl;
return T();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you return default constructed object if the "class contains error"?

Comment thread ClassFactory/ClassFactory.tpp Outdated
} else {
writeToLogs("Error in public getVar: variable not found");
cout << "Variable not found" << endl;
return T();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. Logs are not good, and i would say not even valid error handling method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants