Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pipeline {
agent any
stages {
stage('code pushed to github') {
steps {
echo 'Commit created to repository'
writeFile(file: 'output.txt', text: 'Se ha lanzado desde jenkins', encoding: 'UTF-8')
}
}

stage('secondary') {
steps {
mail(subject: 'Jenkins step', body: 'Testing', to: 'daniel.gallo1989@gmail.com')
}
}

}
}
11 changes: 11 additions & 0 deletions code/AbstractFactory/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,35 @@ 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();


//Delete created objects for avoiding memory leaks
delete fc;
delete pa;
delete pb;
delete fc2;
delete pa2;
delete pb2;

//return exit code
return 0;
}
4 changes: 4 additions & 0 deletions code/Singleton/Singleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

};
Expand Down
1 change: 1 addition & 0 deletions code/main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <iostream>


using namespace std;

int main(int argc, char *argv[])
Expand Down