Skip to content

Instantly share code, notes, and snippets.

View FONQRI's full-sized avatar
๐Ÿ†
Focusing

Behnam Sabaghi FONQRI

๐Ÿ†
Focusing
View GitHub Profile
@FONQRI
FONQRI / VisitorDesignPattern.cpp
Created January 1, 2018 19:47
visitor Design Pattern in c++
#include <iostream>
#include <list>
#include <memory>
using namespace std;
// Forwards
class VisitorIntf;
// Abstract interface for Element objects
class ElementIntf {
@FONQRI
FONQRI / FacadeDesignPattern.cpp
Created January 1, 2018 20:15
Facade Design Pattern in c++
#include <iostream>
#include <memory>
using namespace std;
// Transfer library
class Usb {
public:
bool isAvailable();
void connect();
@FONQRI
FONQRI / BuilderDesignPattern.cpp
Created January 2, 2018 04:54
Builder Design Pattern in c++
#include <iostream>
#include <memory>
#include <queue>
#include <string>
using namespace std;
// Product
class Meal {
public:
@FONQRI
FONQRI / CompositeDesignPattern.cpp
Created January 2, 2018 10:13
Composite Design Pattern in c++
#include <algorithm>
#include <iostream>
#include <list>
#include <memory>
#include <string>
using namespace std;
class DiagnosticInterface {
public:
@FONQRI
FONQRI / DecoratorDesignPattern.cpp
Created January 2, 2018 13:50
C++ Decorator Design Pattern
#include <iostream>
#include <memory>
#include <string>
using namespace std;
class actor {
public:
actor();
virtual ~actor();
@FONQRI
FONQRI / test_vector_and_shared_ptr.cpp
Created January 23, 2018 12:21
vector of shared_prt or shared_ptr of vector in c++
#include <iostream>
#include <memory>
#include <vector>
class TestClass {
public:
TestClass(int id);
~TestClass();
public:
@FONQRI
FONQRI / GeneticAlgorithm.cpp
Created January 30, 2018 12:08
Little example of how genetic algorithms can work in c++
#include <algorithm>
#include <chrono>
#include <cmath>
#include <iostream>
#include <thread>
#include <time.h>
#include <vector>
// lets create a population
struct Member {
@FONQRI
FONQRI / CMakeLists.txt
Last active June 25, 2018 14:57
Sample Boost Cmake
cmake_minimum_required(VERSION 2.8.12)
project(UCCP_Server_Boost)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
include_directories(./src)
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false