summaryrefslogtreecommitdiff
path: root/MuscleEMGProfile.h
blob: 2783b2612f37d26e6e00662de09433fb8ae6c39f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef MUSCLE_EMG_PROFILE_H_
#define MUSCLE_EMG_PROFILE_H_

#include <ostream>
#include <string>
#include <vector>

class MuscleEMGProfile {
public:
	MuscleEMGProfile(const std::string &name, unsigned capacity)
			: _name(const_cast<std::string &>(name))
	{
		if (capacity == 0)
			capacity = 100;
		_x.reserve(capacity);
		_y.reserve(capacity);
	}

	MuscleEMGProfile& operator=(const MuscleEMGProfile &m)
	{
		_name = m._name;
		_x = m._x;
		_y = m._y;

		return *this;
	}

	unsigned getIdx() { return _x.size(); }
	unsigned getCapacity() { return _x.capacity(); }
	const std::string &getName() { return _name; }

	void addData(double x, double y);

private:
	std::string _name;
	std::vector<double> _x;
	std::vector<double> _y;

//	friend std::ostream& operator<<(std::ostream &s, const MuscleEMGProfile &m);
};

/*
std::ostream& operator<<(std::ostream &s, const MuscleEMGProfile &m)
{
	return s << "MuscleEMGProfile(" << m._name << ", " << m._idx << "/" << m._capacity << ")" << std::endl;
}
*/

#endif /* MUSCLE_EMG_PROFILE_H_ */