VoidingWarranties/Myo-Intelligesture — pull request #5 by VoidingWarranties (2014-11-12 10:09:29+00:00)
Title: Inheritance refactor

Changed class communication structure to inheritance as per issue #1. An example use of this library is shown in ExampleClass (also shown below) which simply prints out poses. Note that onPeriodic must be called in the event loop.
```c++
template , class PoseClass = PoseGestures<>::Pose>
class ExampleClass : public BaseClass {
public:
void onPose(myo::Myo* myo, PoseClass pose) {
std::cout << pose << std::endl;
}
};

int main() {
try {
myo::Hub hub("com.voidingwarranties.myo-intelligesture");
myo::Myo* myo = hub.waitForMyo(10000);
if (!myo) {
throw std::runtime_error("Unable to find a Myo!");
}
ExampleClass<> listener;
hub.addListener(&listener);

// Event loop.
while (true) {
hub.run(1000 / 20);
listener.onPeriodic(myo);
}
} catch (const std::exception& ex) {
std::cerr << "Error: " << ex.what() << std::endl;
return 1;
}
return 0;
}
```