diff --git a/05_OO/shapes_main.cpp b/05_OO/shapes_main.cpp index fc7b247..7b012c5 100644 --- a/05_OO/shapes_main.cpp +++ b/05_OO/shapes_main.cpp @@ -1,87 +1,113 @@ #include #include -#include "AnsiConsole.h" +#include "../helpers/AnsiConsole.h" -struct Position{ - int x; - int y; - Position(int x_=0, int y_=0){ x=x_;y=y_;} +struct Position { + int x; + int y; + + Position(int x_ = 0, int y_ = 0) { + x = x_; + y = y_; + } }; -class Point{ +class Point { protected: - Position _position; + Position _position; public: - Point(int x=0, int y=0); - void draw(); + Point(int x = 0, int y = 0); + + void draw(); }; -Point::Point(int x, int y){ - _position = Position(x,y); +Point::Point(int x, int y) { + _position = Position(x, y); } -void Point::draw(){ - ansiConsole.printText(_position.x,_position.y,"*", Colors::RED); +void Point::draw() { + ansiConsole.printText(_position.x, _position.y, "*", Colors::RED); } -class Circle{ +class Circle { protected: - Position _position; - int _radius; + Position _position; + int _radius; public: - Circle(int x=0, int y=0, int radius=0); - void draw(); + Circle(int x = 0, int y = 0, int radius = 0); + + void draw(); }; -Circle::Circle(int x, int y, int radius){ - _position = Position(x,y); - _radius=radius; +Circle::Circle(int x, int y, int radius) { + _position = Position(x, y); + _radius = radius; } -void Circle::draw(){ - /* see https://de.wikibooks.org/wiki/Formelsammlung_Mathematik:_Geometrie - * Höhensatz des Euklid - * */ - int x_start = _position.x - _radius/2; - int x_stop = _position.x + _radius/2; +void Circle::draw() { + /* see https://de.wikibooks.org/wiki/Formelsammlung_Mathematik:_Geometrie + * Höhensatz des Euklid + * */ + int x_start = _position.x - _radius / 2; + int x_stop = _position.x + _radius / 2; - for(int i=x_start; i<=x_stop; i++){ - double x_relative = double(i) - double(x_start); - double h = sqrt(x_relative*(x_stop-x_start-x_relative)); - ansiConsole.printText(_position.x + int(x_relative)- _radius/2, - _position.y +h,"#", - Colors::GREEN); - ansiConsole.printText(_position.x + int(x_relative)- _radius/2, - _position.y -h,"#", - Colors::GREEN); + for (int i = x_start; i <= x_stop; i++) { + double x_relative = double(i) - double(x_start); + double h = sqrt(x_relative * (x_stop - x_start - x_relative)); + ansiConsole.printText(_position.x + int(x_relative) - _radius / 2, + _position.y + h, "#", + Colors::GREEN); + ansiConsole.printText(_position.x + int(x_relative) - _radius / 2, + _position.y - h, "#", + Colors::GREEN); - } + } } -int main(int argc, char **argv) -{ - // x=1 and y=1 is the upper left corner - // x and y are more like column and row - ansiConsole.printText(5,5,"Hello, World!"); +class Rectangle { +protected: + Position position; + int width; + int height; - Point* p = new Point(10,10); - p->draw(); +public: + Rectangle(int x = 0, int y = 0, int width = 0, int height = 0); + void draw(); +}; - Point* p2 = new Point(2,10); - p2->draw(); - - - Circle* c = new Circle(30, 15, 10); - c->draw(); - - Point* p3= new Point(30,15); - p3->draw(); - - - delete p; - delete p2; - delete p3; - delete c; - - return 0; +Rectangle::Rectangle(int x, int y, int width, int height) { + position = Position(x, y); + this->width = width; + this->height = height; +} + +void Rectangle::draw() { + +} + +int main(int argc, char **argv) { + // x=1 and y=1 is the upper left corner + // x and y are more like column and row + ansiConsole.printText(5, 5, "Hello, World!"); + + Point *p = new Point(10, 10); + p->draw(); + + Point *p2 = new Point(2, 10); + p2->draw(); + + + Circle *c = new Circle(30, 15, 10); + c->draw(); + + Point *p3 = new Point(30, 15); + p3->draw(); + + + delete p; + delete p2; + delete p3; + delete c; + + return 0; } diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.pbxproj b/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.pbxproj deleted file mode 100644 index 14d1bd8..0000000 --- a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.pbxproj +++ /dev/null @@ -1,245 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 65413E911CEB65E5008BE849 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65413E901CEB65E5008BE849 /* main.cpp */; }; - 65413E991CEB6612008BE849 /* OneByOneMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65413E971CEB6612008BE849 /* OneByOneMatrix.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 65413E8B1CEB65E5008BE849 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 65413E8D1CEB65E5008BE849 /* CopyOnWrite */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CopyOnWrite; sourceTree = BUILT_PRODUCTS_DIR; }; - 65413E901CEB65E5008BE849 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; - 65413E971CEB6612008BE849 /* OneByOneMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OneByOneMatrix.cpp; sourceTree = ""; }; - 65413E981CEB6612008BE849 /* OneByOneMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneByOneMatrix.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 65413E8A1CEB65E5008BE849 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 65413E841CEB65E5008BE849 = { - isa = PBXGroup; - children = ( - 65413E8F1CEB65E5008BE849 /* CopyOnWrite */, - 65413E8E1CEB65E5008BE849 /* Products */, - ); - sourceTree = ""; - }; - 65413E8E1CEB65E5008BE849 /* Products */ = { - isa = PBXGroup; - children = ( - 65413E8D1CEB65E5008BE849 /* CopyOnWrite */, - ); - name = Products; - sourceTree = ""; - }; - 65413E8F1CEB65E5008BE849 /* CopyOnWrite */ = { - isa = PBXGroup; - children = ( - 65413E901CEB65E5008BE849 /* main.cpp */, - 65413E971CEB6612008BE849 /* OneByOneMatrix.cpp */, - 65413E981CEB6612008BE849 /* OneByOneMatrix.h */, - ); - path = CopyOnWrite; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 65413E8C1CEB65E5008BE849 /* CopyOnWrite */ = { - isa = PBXNativeTarget; - buildConfigurationList = 65413E941CEB65E5008BE849 /* Build configuration list for PBXNativeTarget "CopyOnWrite" */; - buildPhases = ( - 65413E891CEB65E5008BE849 /* Sources */, - 65413E8A1CEB65E5008BE849 /* Frameworks */, - 65413E8B1CEB65E5008BE849 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = CopyOnWrite; - productName = CopyOnWrite; - productReference = 65413E8D1CEB65E5008BE849 /* CopyOnWrite */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 65413E851CEB65E5008BE849 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0620; - ORGANIZATIONNAME = HSEL; - TargetAttributes = { - 65413E8C1CEB65E5008BE849 = { - CreatedOnToolsVersion = 6.2; - }; - }; - }; - buildConfigurationList = 65413E881CEB65E5008BE849 /* Build configuration list for PBXProject "CopyOnWrite" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 65413E841CEB65E5008BE849; - productRefGroup = 65413E8E1CEB65E5008BE849 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 65413E8C1CEB65E5008BE849 /* CopyOnWrite */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 65413E891CEB65E5008BE849 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 65413E911CEB65E5008BE849 /* main.cpp in Sources */, - 65413E991CEB6612008BE849 /* OneByOneMatrix.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 65413E921CEB65E5008BE849 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - 65413E931CEB65E5008BE849 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.9; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - 65413E951CEB65E5008BE849 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 65413E961CEB65E5008BE849 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 65413E881CEB65E5008BE849 /* Build configuration list for PBXProject "CopyOnWrite" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 65413E921CEB65E5008BE849 /* Debug */, - 65413E931CEB65E5008BE849 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 65413E941CEB65E5008BE849 /* Build configuration list for PBXNativeTarget "CopyOnWrite" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 65413E951CEB65E5008BE849 /* Debug */, - 65413E961CEB65E5008BE849 /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = 65413E851CEB65E5008BE849 /* Project object */; -} diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 62b8b09..0000000 --- a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.xcworkspace/xcuserdata/clink.xcuserdatad/UserInterfaceState.xcuserstate b/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.xcworkspace/xcuserdata/clink.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 21ac3ed..0000000 Binary files a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/project.xcworkspace/xcuserdata/clink.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/xcuserdata/clink.xcuserdatad/xcschemes/CopyOnWrite.xcscheme b/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/xcuserdata/clink.xcuserdatad/xcschemes/CopyOnWrite.xcscheme deleted file mode 100644 index ae4057b..0000000 --- a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/xcuserdata/clink.xcuserdatad/xcschemes/CopyOnWrite.xcscheme +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/xcuserdata/clink.xcuserdatad/xcschemes/xcschememanagement.plist b/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/xcuserdata/clink.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index a513042..0000000 --- a/11_PUTT/CopyOnWrite/CopyOnWrite.xcodeproj/xcuserdata/clink.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - CopyOnWrite.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 65413E8C1CEB65E5008BE849 - - primary - - - - - diff --git a/11_PUTT/CopyOnWrite/LargeCowMatrix.cpp b/11_PUTT/CopyOnWrite/LargeCowMatrix.cpp new file mode 100644 index 0000000..0e4c6de --- /dev/null +++ b/11_PUTT/CopyOnWrite/LargeCowMatrix.cpp @@ -0,0 +1,48 @@ +#include +#include "LargeCowMatrix.h" + +int LargeCowMatrix::instanceCounter = 0; + +LargeCowMatrix::LargeCowMatrix() : value(-1), referenceCounter(0){ + instanceCounter++; +} + +LargeCowMatrix::LargeCowMatrix(int value) : value(value), referenceCounter(0){ + instanceCounter++; +} + +LargeCowMatrix::LargeCowMatrix(const LargeCowMatrix& source) : value(source.value), referenceCounter(source.referenceCounter){ + instanceCounter++; +} + +LargeCowMatrix::~LargeCowMatrix() { + instanceCounter--; +} + +LargeCowMatrix::operator int() { + return value; +} + +LargeCowMatrix LargeCowMatrix::operator+(const LargeCowMatrix &other) { + return LargeCowMatrix(value + other.value); +} + +LargeCowMatrix &LargeCowMatrix::operator++(int) { + value++; + return *this; +} + +bool LargeCowMatrix::operator==(const LargeCowMatrix &other) { + return this->value == other.value; +} + +bool LargeCowMatrix::operator!=(const LargeCowMatrix &other) { + return !(*this==other); +} + +bool LargeCowMatrix::instanceCountExceeds(int max) { + bool result = instanceCounter>max; + if(result) + std::cout << LargeCowMatrix::instanceCounter << " > max=" << max << std::endl; + return result; +} diff --git a/11_PUTT/CopyOnWrite/LargeCowMatrix.h b/11_PUTT/CopyOnWrite/LargeCowMatrix.h new file mode 100644 index 0000000..2566e89 --- /dev/null +++ b/11_PUTT/CopyOnWrite/LargeCowMatrix.h @@ -0,0 +1,26 @@ +#ifndef TEST_BUILD_LARGECOWMATRIX_H +#define TEST_BUILD_LARGECOWMATRIX_H + + +class LargeCowMatrix { + int value; + int referenceCounter; + static int instanceCounter; + +public: + LargeCowMatrix(); + explicit LargeCowMatrix(int value); + LargeCowMatrix(const LargeCowMatrix&); + ~LargeCowMatrix(); + + explicit operator int(); + LargeCowMatrix operator+(const LargeCowMatrix & other); + LargeCowMatrix& operator ++(int); + bool operator==(const LargeCowMatrix& other); + bool operator!=(const LargeCowMatrix& other); + + static bool instanceCountExceeds(int max); +}; + + +#endif //TEST_BUILD_LARGECOWMATRIX_H diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite/OneByOneMatrix.cpp b/11_PUTT/CopyOnWrite/OneByOneMatrix.cpp similarity index 78% rename from 11_PUTT/CopyOnWrite/CopyOnWrite/OneByOneMatrix.cpp rename to 11_PUTT/CopyOnWrite/OneByOneMatrix.cpp index 921f8d8..55886f3 100644 --- a/11_PUTT/CopyOnWrite/CopyOnWrite/OneByOneMatrix.cpp +++ b/11_PUTT/CopyOnWrite/OneByOneMatrix.cpp @@ -14,20 +14,17 @@ int OneByOneMatrix::s_instanceCounter=0; -OneByOneMatrix::OneByOneMatrix() -: m_value(-1), m_referenceCounter(0) +OneByOneMatrix::OneByOneMatrix() : m_value(-1), m_referenceCounter(0) { s_instanceCounter++; } -OneByOneMatrix::OneByOneMatrix(int initialValue) -: m_value(initialValue), m_referenceCounter(0) +OneByOneMatrix::OneByOneMatrix(int initialValue) : m_value(initialValue), m_referenceCounter(0) { s_instanceCounter++; } -OneByOneMatrix::OneByOneMatrix(const OneByOneMatrix& source) -: m_value(source.m_value), m_referenceCounter(source.m_referenceCounter) +OneByOneMatrix::OneByOneMatrix(const OneByOneMatrix& source) : m_value(source.m_value), m_referenceCounter(source.m_referenceCounter) { s_instanceCounter++; } diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite/OneByOneMatrix.h b/11_PUTT/CopyOnWrite/OneByOneMatrix.h similarity index 96% rename from 11_PUTT/CopyOnWrite/CopyOnWrite/OneByOneMatrix.h rename to 11_PUTT/CopyOnWrite/OneByOneMatrix.h index 0eccc69..afefa2f 100644 --- a/11_PUTT/CopyOnWrite/CopyOnWrite/OneByOneMatrix.h +++ b/11_PUTT/CopyOnWrite/OneByOneMatrix.h @@ -34,9 +34,5 @@ public: // imagine this class as an abstraction for very large matrices -class LargeCowMatrix { - -}; - #endif /* defined(__CopyOnWrite__OneByOneMatrix__) */ diff --git a/11_PUTT/CopyOnWrite/CopyOnWrite/main.cpp b/11_PUTT/CopyOnWrite/main.cpp similarity index 94% rename from 11_PUTT/CopyOnWrite/CopyOnWrite/main.cpp rename to 11_PUTT/CopyOnWrite/main.cpp index 9941c93..4d1b8eb 100644 --- a/11_PUTT/CopyOnWrite/CopyOnWrite/main.cpp +++ b/11_PUTT/CopyOnWrite/main.cpp @@ -8,14 +8,14 @@ #include - #include "OneByOneMatrix.h" +#include "LargeCowMatrix.h" int failCounter=0; -typedef int NumberType; +//typedef int NumberType; //typedef OneByOneMatrix NumberType; -//typedef LargeCowMatrix NumberType; +typedef LargeCowMatrix NumberType; void simpleTests(){ diff --git a/CMakeLists.txt b/CMakeLists.txt index 14cf3e3..a4cf71d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,19 @@ set(UDEF_TESTAT UserDefinedTypesTestat) set(UDEF_TESTAT_SOURCE 04_UDEF/Testat/Testat.cpp) add_executable(${UDEF_TESTAT} ${UDEF_TESTAT_SOURCE}) +set(05_SHAPES 05_Shapes) +set(05_SHAPES_SOURCE 05_OO/shapes_main.cpp) +add_executable(${05_SHAPES} helpers/AnsiConsole.cpp ${05_SHAPES_SOURCE}) + + set(SEQUENCE_DIAGRAM SequenzDiagram) set(SEQUENCE_DIAGRAM_SOURCE 11_PUTT/05_OO_b/main.cpp) add_executable(${SEQUENCE_DIAGRAM} 11_PUTT/05_OO_b/SequenceDiagramCreator.cpp ${SEQUENCE_DIAGRAM_SOURCE}) set(LCDDISPLAY LCDDisplay) set(LCDDISPLAY_SOURCE 11_PUTT/02_Ment/LCDDisplay.cpp) -add_executable(${LCDDISPLAY} ${LCDDISPLAY_SOURCE}) \ No newline at end of file +add_executable(${LCDDISPLAY} ${LCDDISPLAY_SOURCE}) + +set(COPY_ON_WRITE CopyOnWrite) +set(COPY_ON_WRITE_SOURCE 11_PUTT/CopyOnWrite/main.cpp) +add_executable(${COPY_ON_WRITE} 11_PUTT/CopyOnWrite/OneByOneMatrix.cpp 11_PUTT/CopyOnWrite/LargeCowMatrix.cpp ${COPY_ON_WRITE_SOURCE}) \ No newline at end of file