Skip to content

Commit 547f50d

Browse files
author
Adam Horvath
committed
Initail commit
0 parents  commit 547f50d

24 files changed

+826
-0
lines changed

.cproject

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
3+
<storageModule moduleId="org.eclipse.cdt.core.settings">
4+
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1324808345">
5+
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1324808345" moduleId="org.eclipse.cdt.core.settings" name="Debug">
6+
<externalSettings/>
7+
<extensions>
8+
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
9+
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
10+
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
11+
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
12+
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
13+
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
14+
</extensions>
15+
</storageModule>
16+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
17+
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1324808345" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
18+
<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1324808345." name="/" resourcePath="">
19+
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.2058173028" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
20+
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.631645193" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
21+
<builder buildPath="${workspace_loc:/cpp11}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.59758397" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
22+
<tool id="cdt.managedbuild.tool.gnu.archiver.base.719411554" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
23+
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1313804263" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
24+
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1699704852" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
25+
<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.198491599" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
26+
<option id="gnu.cpp.compiler.option.dialect.std.905012465" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
27+
<option id="gnu.cpp.compiler.option.dialect.flags.653004399" name="Other dialect flags" superClass="gnu.cpp.compiler.option.dialect.flags" value="" valueType="string"/>
28+
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2135002407" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
29+
</tool>
30+
<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.2025000179" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
31+
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.2111178782" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
32+
<option id="gnu.c.compiler.exe.debug.option.debugging.level.1891098019" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
33+
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1609169817" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
34+
</tool>
35+
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1973776863" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
36+
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1041388704" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
37+
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2104993532" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
38+
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
39+
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
40+
</inputType>
41+
</tool>
42+
<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1247680128" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
43+
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1475884456" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
44+
</tool>
45+
</toolChain>
46+
</folderInfo>
47+
<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1324808345.1829395271" name="/" resourcePath="src">
48+
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1024983883" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug" unusedChildren="">
49+
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
50+
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1880010918" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base.719411554"/>
51+
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.514295517" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1313804263">
52+
<option id="gnu.cpp.compiler.option.dialect.std.326929425" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
53+
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.433822301" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
54+
</tool>
55+
<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1711539205" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.2025000179">
56+
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1026193782" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
57+
</tool>
58+
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.217640052" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1973776863"/>
59+
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1310488324" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1041388704"/>
60+
<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1373296474" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug.1247680128">
61+
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.935132146" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
62+
</tool>
63+
</toolChain>
64+
</folderInfo>
65+
<sourceEntries>
66+
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
67+
</sourceEntries>
68+
</configuration>
69+
</storageModule>
70+
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
71+
</cconfiguration>
72+
<cconfiguration id="cdt.managedbuild.config.gnu.exe.release.389090718">
73+
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.389090718" moduleId="org.eclipse.cdt.core.settings" name="Release">
74+
<externalSettings/>
75+
<extensions>
76+
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
77+
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
78+
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
79+
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
80+
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
81+
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
82+
</extensions>
83+
</storageModule>
84+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
85+
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.389090718" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
86+
<folderInfo id="cdt.managedbuild.config.gnu.exe.release.389090718." name="/" resourcePath="">
87+
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.1967162985" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
88+
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1368728741" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
89+
<builder buildPath="${workspace_loc:/cpp11}/Release" id="cdt.managedbuild.target.gnu.builder.exe.release.2047716480" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
90+
<tool id="cdt.managedbuild.tool.gnu.archiver.base.671250424" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
91+
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1571788339" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
92+
<option id="gnu.cpp.compiler.exe.release.option.optimization.level.1380197831" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
93+
<option id="gnu.cpp.compiler.exe.release.option.debugging.level.704854381" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
94+
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.20544548" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
95+
</tool>
96+
<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.743277043" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
97+
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.774733642" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
98+
<option id="gnu.c.compiler.exe.release.option.debugging.level.352160993" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
99+
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1419347501" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
100+
</tool>
101+
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.370653671" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
102+
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1771661709" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
103+
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.341199000" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
104+
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
105+
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
106+
</inputType>
107+
</tool>
108+
<tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.114550450" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
109+
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.615726596" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
110+
</tool>
111+
</toolChain>
112+
</folderInfo>
113+
<sourceEntries>
114+
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
115+
</sourceEntries>
116+
</configuration>
117+
</storageModule>
118+
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
119+
</cconfiguration>
120+
</storageModule>
121+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
122+
<project id="cpp11.cdt.managedbuild.target.gnu.exe.77192981" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
123+
</storageModule>
124+
<storageModule moduleId="scannerConfiguration">
125+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
126+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.389090718;cdt.managedbuild.config.gnu.exe.release.389090718.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.743277043;cdt.managedbuild.tool.gnu.c.compiler.input.1419347501">
127+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
128+
</scannerConfigBuildInfo>
129+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.389090718;cdt.managedbuild.config.gnu.exe.release.389090718.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1571788339;cdt.managedbuild.tool.gnu.cpp.compiler.input.20544548">
130+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
131+
</scannerConfigBuildInfo>
132+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1324808345;cdt.managedbuild.config.gnu.exe.debug.1324808345.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.2025000179;cdt.managedbuild.tool.gnu.c.compiler.input.1609169817">
133+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
134+
</scannerConfigBuildInfo>
135+
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1324808345;cdt.managedbuild.config.gnu.exe.debug.1324808345.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1313804263;cdt.managedbuild.tool.gnu.cpp.compiler.input.2135002407">
136+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
137+
</scannerConfigBuildInfo>
138+
</storageModule>
139+
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
140+
<storageModule moduleId="refreshScope" versionNumber="2">
141+
<configuration configurationName="Debug">
142+
<resource resourceType="PROJECT" workspacePath="/cpp11"/>
143+
</configuration>
144+
<configuration configurationName="Release">
145+
<resource resourceType="PROJECT" workspacePath="/cpp11"/>
146+
</configuration>
147+
</storageModule>
148+
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
149+
</cproject>

.project

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>cpp11</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
<buildCommand>
15+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
16+
<triggers>full,incremental,</triggers>
17+
<arguments>
18+
</arguments>
19+
</buildCommand>
20+
</buildSpec>
21+
<natures>
22+
<nature>org.eclipse.cdt.core.cnature</nature>
23+
<nature>org.eclipse.cdt.core.ccnature</nature>
24+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
25+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
26+
</natures>
27+
</projectDescription>

src/Async.cpp

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include "Async.h"
2+
#include <iostream>
3+
#include <future>
4+
#include <chrono>
5+
#include <thread>
6+
#include <random>
7+
#include <cstdlib>
8+
9+
int takeFive() {return 5;}
10+
11+
Async::Async() {}
12+
13+
Async::~Async() {}
14+
15+
void Async::GetForecasts() const
16+
{
17+
//std::future<int> debrecen = std::async( GetCityForecast, std::string("Debrecen") );
18+
std::future<int> d2 = std::async( takeFive );
19+
// auto lima = std::async( GetCityForecast, "Lima" );
20+
// auto norberg = std::async( GetCityForecast, "Norberg" );
21+
// auto piemonte = std::async( GetCityForecast, "Piemonte" );
22+
//
23+
// // Perform other tasks here while temperatures get fetched
24+
//
25+
26+
27+
int i = d2.get();
28+
std::cout << "Temperature Forecasts: " << std::endl;
29+
// std::cout << "Debrecen: " << debrecen.get() << std::endl;
30+
// std::cout << "Lima: " << lima.get() << std::endl;
31+
// std::cout << "Norberg: " << norberg.get() << std::endl;
32+
// std::cout << "Piemonte: " << piemonte.get() << std::endl;
33+
34+
}
35+
36+
37+
38+
int Async::GetCityForecast( std::string city )
39+
{
40+
return 5;
41+
// int delay = 2 + std::rand() % 8;
42+
// std::this_thread::sleep_for (std::chrono::seconds(delay));
43+
//
44+
// int temperature = -5 + std::rand() % 40;
45+
// return temperature;
46+
}

src/Async.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef ASYNC_H_
2+
#define ASYNC_H_
3+
4+
#include <string>
5+
6+
class Async {
7+
public:
8+
Async();
9+
virtual ~Async();
10+
11+
void GetForecasts() const;
12+
13+
static int GetCityForecast( std::string city );
14+
};
15+
16+
#endif /* ASYNC_H_ */

src/Containers.cpp

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#include "Containers.h"
2+
#include <iostream>
3+
4+
Containers::Containers() {}
5+
6+
Containers::~Containers() {}
7+
8+
void Containers::ListCities() const
9+
{
10+
std::cout << std::endl << "Cool movie cities in the world: " << std::endl;
11+
for(auto& city: m_movieCities)
12+
{
13+
std::cout << city << std::endl;
14+
}
15+
}
16+
17+
void Containers::ListCodes() const
18+
{
19+
std::cout << std::endl << "Some country codes in the world: " << std::endl;
20+
21+
for(auto& pair: m_countryCodes)
22+
{
23+
std::cout << pair.first << "\t" << pair.second << std::endl;
24+
}
25+
}
26+
27+
const std::vector<std::string> Containers::m_movieCities =
28+
{
29+
"Hollywood",
30+
"Bollywood",
31+
"Filmstaden",
32+
"Cinecitta",
33+
"Avala Film"
34+
};
35+
36+
const std::map<int, std::string> Containers::m_countryCodes =
37+
{
38+
{ 36, "Hungary" },
39+
{ 91, "India" },
40+
{ 46, "Sweden" },
41+
{ 1, "USA" }
42+
};

src/Containers.h

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include <vector>
2+
#include <map>
3+
#include <string>
4+
5+
#ifndef CONTAINERS_H_
6+
#define CONTAINERS_H_
7+
8+
class Containers {
9+
public:
10+
Containers();
11+
virtual ~Containers();
12+
13+
void ListCities() const;
14+
void ListCodes() const;
15+
16+
private:
17+
static const std::vector<std::string> m_movieCities;
18+
static const std::map<int, std::string> m_countryCodes;
19+
};
20+
21+
#endif

src/Enums.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <iostream>
2+
#include "Enums.h"
3+
4+
Enums::Enums() {}
5+
6+
Enums::~Enums() {}
7+
8+
void Enums::WineTesting(Wine w) const
9+
{
10+
if(w == Wine::RED)
11+
{
12+
std::cout << "The wine is red" << std::endl;
13+
}
14+
else
15+
{
16+
std::cout << "The wine sure aint red" << std::endl;
17+
}
18+
}

src/Enums.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef ENUMS_H_
2+
#define ENUMS_H_
3+
4+
class Enums {
5+
6+
public:
7+
Enums();
8+
virtual ~Enums();
9+
10+
enum class Colour { RED, GREEN, BLUE };
11+
enum class Wine { WHITE, RED };
12+
13+
void WineTesting(Wine w) const;
14+
};
15+
16+
#endif /* ENUMS_H_ */

src/FortyTwo.cpp

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include "FortyTwo.h"
2+
#include "iostream"
3+
4+
FortyTwo::FortyTwo() { }
5+
6+
FortyTwo::FortyTwo(const std::string& s): m_s( s ) { }
7+
8+
FortyTwo::FortyTwo( double d ): m_d( d ) { }
9+
10+
FortyTwo::FortyTwo( int i ): m_i( i ) { }
11+
12+
FortyTwo::~FortyTwo() { }
13+
14+
void FortyTwo::PrintMembers() const
15+
{
16+
std::cout << __PRETTY_FUNCTION__ << " | members: " << m_s << "\t " << m_d << "\t " << m_i << std::endl;
17+
}
18+
19+
const std::string& FortyTwo::GetStr() const
20+
{
21+
return m_s;
22+
}
23+
24+
double FortyTwo::GetDouble() const
25+
{
26+
return m_d;
27+
}
28+
29+
int FortyTwo::GetInt() const
30+
{
31+
return m_i;
32+
}

0 commit comments

Comments
 (0)