Created
January 28, 2018 16:24
-
-
Save LiewJunTung/755913189d9bb62ed92aabfbbdac3afc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "calculator_impl.hpp" | |
#include <string> | |
namespace calculator{ | |
std::shared_ptr<Calculator> Calculator::create() { | |
return std::make_shared<CalculatorImpl>(); | |
} | |
CalculatorImpl::CalculatorImpl() { | |
} | |
int32_t CalculatorImpl::summation(int32_t number1, int32_t number2) { | |
int32_t result = number1 + number2; | |
return result; | |
} | |
int32_t CalculatorImpl::subtraction(int32_t number1, int32_t number2) { | |
int32_t result = number1 - number2; | |
return result; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "calculator.hpp" | |
namespace calculator { | |
class CalculatorImpl : public calculator::Calculator { | |
public: | |
CalculatorImpl(); | |
int32_t summation(int32_t number1, int32_t number2); | |
int32_t subtraction(int32_t number1, int32_t number2); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment