/*
 * factories.hpp
 *
 * Factories for creating XSens and
 *
 *  Created on: 20 Oct 2014
 *      Author: timothyw
 */

#ifndef AUTOLEVEL_FACTORIES_HPP_
#define AUTOLEVEL_FACTORIES_HPP_

#include <crosbot/handle.hpp>
#include <autolevel/autolevelChain.hpp>
#include <xsens/xsens.h>

namespace casualty {

/**
 * Factory for creating XSens objects
 */
class FactoryXSens : public crosbot::HandledObject {
public:
	virtual XSensPtr makeXSens() = 0;
	virtual XSensPtr makeXSens(std::string port, bool resetOnStart) = 0;
};
typedef crosbot::Handle<FactoryXSens> FactoryXSensPtr;

class DefaultFactoryXSens : public FactoryXSens {
public:
	XSensPtr makeXSens() { return new XSens(); };
	XSensPtr makeXSens(std::string port, bool resetOnStart) { return new XSens(port, resetOnStart); };
};

/**
 * Factory for creating Dynamixel Chains
 */
class FactoryAutoLevelChain : public crosbot::HandledObject {
public:
	virtual AutoLevelChainPtr makeAutoLevelChain() = 0;
};
typedef crosbot::Handle<FactoryAutoLevelChain> FactoryAutoLevelChainPtr;

class DefaultFactoryAutoLevelChain : public FactoryAutoLevelChain {
public:
	AutoLevelChainPtr makeAutoLevelChain() { return new AutoLevelChain(); };
};

} // namespace casualty

#endif /* AUTOLEVEL_FACTORIES_HPP_ */
