Skip to content

Instantly share code, notes, and snippets.

@a7ul
Created June 15, 2018 09:18
Show Gist options
  • Save a7ul/45feebaf7eb6e895077b6bd8a5d837aa to your computer and use it in GitHub Desktop.
Save a7ul/45feebaf7eb6e895077b6bd8a5d837aa to your computer and use it in GitHub Desktop.
blog-on-node-addon-class
/* 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_;
}
/* 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