Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some comments to clarify. Also testing Pull request functionality #51

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
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: '[email protected]')
}
}

}
}
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