Created
June 15, 2018 09:18
-
-
Save a7ul/45feebaf7eb6e895077b6bd8a5d837aa to your computer and use it in GitHub Desktop.
blog-on-node-addon-class
This file contains 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
/* cppsrc/Samples/actualclass.cpp */ | |
#include "actualclass.h" | |
ActualClass::ActualClass(double value){ | |
this->value_ = value; | |
} | |
double ActualClass::getValue() | |
{ | |
return this->value_; | |
} | |
double ActualClass::add(double toAdd) | |
{ | |
this->value_ += toAdd; | |
return this->value_; | |
} |
This file contains 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
/* cppsrc/Samples/actualclass.h */ | |
class ActualClass { | |
public: | |
ActualClass(double value); //constructor | |
double getValue(); //getter for the value | |
double add(double toAdd); //adds the toAdd value to the value_ | |
private: | |
double value_; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment