Suppose I have 2 files in my project: "code.h" and "readData.cpp". The code.h file has my class interface (and some of the member function definitions), and the readData.cpp file has the definition of one of my class's private member functions.
Suppose this is the contents of my code.h file:
Class MyClass {
public:
MyClass() { readData() };
double sample();
private:
std::vector<double> data;
void readData();
void foo();
};
double MyClass::sample() {
// ...
}
void MyClass::foo() {
// ...
}
Suppose this is the contents of my readData.cpp file:
#include "code.h"
void MyClass::readData() {
data.push_back(1.3083);
data.push_back(83.24);
// ...
}
Now, after compiling and producing the object file "readData.o", I create a library using the code:
ar rvs myLib.a readData.o
OK, so far so good. But here's where my question comes. I would like to distribute this myLib.a library and only permit other users to see something like the following interface:
Class MyClass {
double sample();
};
How can I do that?