Rolling back use of typedef with smart pointers.

This is to reduce the obfuscation of the code.
This commit is contained in:
Ian Dinwoodie
2019-05-18 10:12:01 -04:00
parent 176fe54642
commit 5a4975691f
7 changed files with 37 additions and 48 deletions

View File

@@ -5,7 +5,6 @@
class Theme
{
public:
typedef std::shared_ptr<Theme> ptr_t;
virtual std::string getColor(void) = 0;
};
@@ -18,7 +17,7 @@ class WebPage
class About : public WebPage
{
public:
About(Theme::ptr_t theme)
About(std::shared_ptr<Theme> theme)
: theme_(theme)
{
}
@@ -29,13 +28,13 @@ class About : public WebPage
}
private:
Theme::ptr_t theme_;
std::shared_ptr<Theme> theme_;
};
class Projects : public WebPage
{
public:
Projects(Theme::ptr_t theme)
Projects(std::shared_ptr<Theme> theme)
: theme_(theme)
{
}
@@ -46,14 +45,14 @@ class Projects : public WebPage
}
private:
Theme::ptr_t theme_;
std::shared_ptr<Theme> theme_;
};
class Careers : public WebPage
{
public:
Careers(Theme::ptr_t theme)
Careers(std::shared_ptr<Theme> theme)
: theme_(theme)
{
}
@@ -64,7 +63,7 @@ class Careers : public WebPage
}
private:
Theme::ptr_t theme_;
std::shared_ptr<Theme> theme_;
};
class DarkTheme : public Theme
@@ -96,7 +95,7 @@ class AquaTheme : public Theme
int main()
{
Theme::ptr_t darkTheme = std::make_shared<DarkTheme>();
std::shared_ptr<Theme> darkTheme = std::make_shared<DarkTheme>();
About about(darkTheme);
Careers careers(darkTheme);