IO is an event based input manager which permit to select which composents are manged on your system

Dependencies:   C12832 FXOS8700Q LM75B MMA7660

Committer:
co838_app56
Date:
Tue Feb 23 17:25:07 2016 +0000
Revision:
0:2ac59c564ab0
Managing k64f & app shield;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
co838_app56 0:2ac59c564ab0 1 #pragma once
co838_app56 0:2ac59c564ab0 2
co838_app56 0:2ac59c564ab0 3 template <typename Type>
co838_app56 0:2ac59c564ab0 4 struct Vector
co838_app56 0:2ac59c564ab0 5 {
co838_app56 0:2ac59c564ab0 6 typedef Vector<Type> This;
co838_app56 0:2ac59c564ab0 7
co838_app56 0:2ac59c564ab0 8 Type x;
co838_app56 0:2ac59c564ab0 9 Type y;
co838_app56 0:2ac59c564ab0 10 Type z;
co838_app56 0:2ac59c564ab0 11
co838_app56 0:2ac59c564ab0 12 Vector(void) : x(0), y(0), z(0) {}
co838_app56 0:2ac59c564ab0 13 Vector(Type X, Type Y, Type Z) : x(X), y(Y), z(Z) {}
co838_app56 0:2ac59c564ab0 14 Vector(const Vector &copy) { *this = copy; }
co838_app56 0:2ac59c564ab0 15
co838_app56 0:2ac59c564ab0 16 This &operator=(const Vector &copy)
co838_app56 0:2ac59c564ab0 17 {
co838_app56 0:2ac59c564ab0 18 x = copy.x;
co838_app56 0:2ac59c564ab0 19 y = copy.y;
co838_app56 0:2ac59c564ab0 20 z = copy.z;
co838_app56 0:2ac59c564ab0 21 return (*this);
co838_app56 0:2ac59c564ab0 22 }
co838_app56 0:2ac59c564ab0 23
co838_app56 0:2ac59c564ab0 24 bool operator==(const Vector &other) const { return (other.x == x && other.y == y && other.z == z); }
co838_app56 0:2ac59c564ab0 25 bool operator!=(const Vector &other) const { return (!(*this == other)); }
co838_app56 0:2ac59c564ab0 26 bool eq(const Vector &other, float prec) const;
co838_app56 0:2ac59c564ab0 27 };