From 771b821864a6cfa416f8eaeabfdf59bf010a4ab6 Mon Sep 17 00:00:00 2001 From: Dani Date: Tue, 27 Jul 2021 20:34:51 +0200 Subject: [PATCH 01/11] added comments to clarify --- code/AbstractFactory/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/AbstractFactory/main.cpp b/code/AbstractFactory/main.cpp index 5dc6653..c17a0fa 100644 --- a/code/AbstractFactory/main.cpp +++ b/code/AbstractFactory/main.cpp @@ -8,15 +8,23 @@ using namespace std; int main(int argc, char *argv[]) { + //Create factory1 AbstractFactory * fc = new ConcreteFactory1(); + + //Create products A and B from factory1 AbstractProductA * pa = fc->createProductA(); AbstractProductB * pb = fc->createProductB(); + + //Use products A and B from factory1 pa->use(); pb->eat(); + //Create factory2 AbstractFactory * fc2 = new ConcreteFactory2(); + //Create products A and B from factory2 AbstractProductA * pa2 = fc2->createProductA(); AbstractProductB * pb2 = fc2->createProductB(); + //Use products A and B from factory2 pa2->use(); pb2->eat(); From 79245708c2f2648e1371a88b17affd631b52a0ca Mon Sep 17 00:00:00 2001 From: Dani Date: Tue, 27 Jul 2021 20:34:51 +0200 Subject: [PATCH 02/11] added comments to clarify --- code/AbstractFactory/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/AbstractFactory/main.cpp b/code/AbstractFactory/main.cpp index 5dc6653..c17a0fa 100644 --- a/code/AbstractFactory/main.cpp +++ b/code/AbstractFactory/main.cpp @@ -8,15 +8,23 @@ using namespace std; int main(int argc, char *argv[]) { + //Create factory1 AbstractFactory * fc = new ConcreteFactory1(); + + //Create products A and B from factory1 AbstractProductA * pa = fc->createProductA(); AbstractProductB * pb = fc->createProductB(); + + //Use products A and B from factory1 pa->use(); pb->eat(); + //Create factory2 AbstractFactory * fc2 = new ConcreteFactory2(); + //Create products A and B from factory2 AbstractProductA * pa2 = fc2->createProductA(); AbstractProductB * pb2 = fc2->createProductB(); + //Use products A and B from factory2 pa2->use(); pb2->eat(); From b2c358bbd5ea9de5ae01bae90505116669ba2584 Mon Sep 17 00:00:00 2001 From: Dani Date: Wed, 28 Jul 2021 17:29:42 +0200 Subject: [PATCH 03/11] added comments for clarification --- code/Singleton/Singleton.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/Singleton/Singleton.h b/code/Singleton/Singleton.h index a877efc..c7eada8 100644 --- a/code/Singleton/Singleton.h +++ b/code/Singleton/Singleton.h @@ -15,12 +15,16 @@ class Singleton virtual ~Singleton(); Singleton *m_Singleton; + //Entry point to method is static and public static Singleton* getInstance(); + + //This function represents the actual operation performed over the object void singletonOperation(); private: static Singleton * instance; + //Constructor shall be declared as private Singleton(); }; From e7fb67f6b8af82239dfeea40890a58a7e80ba1f8 Mon Sep 17 00:00:00 2001 From: Dani Date: Thu, 5 Aug 2021 12:37:02 +0200 Subject: [PATCH 04/11] testing jenkins --- code/main/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/main/main.cpp b/code/main/main.cpp index 3cdcdbb..8f25ba5 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -1,5 +1,6 @@ #include + using namespace std; int main(int argc, char *argv[]) From 9c15ef42d2b346a29522c0433d493d0bf95fa3d9 Mon Sep 17 00:00:00 2001 From: Dani Date: Mon, 9 Aug 2021 11:46:48 +0200 Subject: [PATCH 05/11] add comments in deleting pointers section --- code/AbstractFactory/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/AbstractFactory/main.cpp b/code/AbstractFactory/main.cpp index c17a0fa..2bd39f3 100644 --- a/code/AbstractFactory/main.cpp +++ b/code/AbstractFactory/main.cpp @@ -28,6 +28,8 @@ int main(int argc, char *argv[]) pa2->use(); pb2->eat(); + + //Delete created objects for avoiding memory leaks delete fc; delete pa; delete pb; From 385319041230d6a151b393d439600765ed07a5b7 Mon Sep 17 00:00:00 2001 From: Dani Date: Mon, 9 Aug 2021 11:57:52 +0200 Subject: [PATCH 06/11] added comment --- code/AbstractFactory/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/AbstractFactory/main.cpp b/code/AbstractFactory/main.cpp index 2bd39f3..120d13a 100644 --- a/code/AbstractFactory/main.cpp +++ b/code/AbstractFactory/main.cpp @@ -37,5 +37,6 @@ int main(int argc, char *argv[]) delete pa2; delete pb2; + //return exit code return 0; } From 355d5d2dc22c8ad70eda15e9e1d174bbbf6e5d81 Mon Sep 17 00:00:00 2001 From: chisteleco <35273095+chisteleco@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:25:06 +0200 Subject: [PATCH 07/11] Added Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f80f9b4 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +pipeline { + agent any + stages { + stage('code pushed to github') { + steps { + echo 'Commit created to repository' + } + } + + } +} \ No newline at end of file From b53ade9cac599698eb29d46875e5aa7114dd7a2b Mon Sep 17 00:00:00 2001 From: chisteleco <35273095+chisteleco@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:33:06 +0200 Subject: [PATCH 08/11] Added Jenkinsfile --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index f80f9b4..d079ef9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,14 @@ pipeline { stage('code pushed to github') { steps { echo 'Commit created to repository' + timestamps() + writeFile(file: 'output.txt', text: 'Se ha lanzado desde jenkins', encoding: 'UTF-8') + } + } + + stage('secondary') { + steps { + mail(subject: 'Jenkins step', body: 'Testing') } } From 220dd1840453ddb5c373526d2a5a3961ba8268a5 Mon Sep 17 00:00:00 2001 From: chisteleco <35273095+chisteleco@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:36:57 +0200 Subject: [PATCH 09/11] Added Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d079ef9..e2e5e83 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,6 @@ pipeline { stage('code pushed to github') { steps { echo 'Commit created to repository' - timestamps() writeFile(file: 'output.txt', text: 'Se ha lanzado desde jenkins', encoding: 'UTF-8') } } From ae5c5953ece65dab969d7785eebfb69de8f794f0 Mon Sep 17 00:00:00 2001 From: chisteleco <35273095+chisteleco@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:38:25 +0200 Subject: [PATCH 10/11] Added Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e2e5e83..169abba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { stage('secondary') { steps { - mail(subject: 'Jenkins step', body: 'Testing') + mail(subject: 'Jenkins step', body: 'Testing', to: 'daniel.gallo1989@gmail.com') } } From 297e3278182c7679d7c3bc0125cca6d2899c0f6b Mon Sep 17 00:00:00 2001 From: chisteleco <35273095+chisteleco@users.noreply.github.com> Date: Tue, 10 Aug 2021 16:17:00 +0200 Subject: [PATCH 11/11] Create c-cpp.yml --- .github/workflows/c-cpp.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..e323326 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,23 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./configure + - name: make + run: make + - name: make check + run: make check + - name: make distcheck + run: make distcheck