aboutsummaryrefslogtreecommitdiffstats
path: root/can-config-generator/src/openxc/mapping.hpp
blob: 30895cbae956b84d3af32122a3fa4d505ac55110 (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
#pragma once

#include <string>
#include <json.hpp>

namespace openxc
{
	class mapping
	{
	private:
		std::string		mapping_name_;
		std::string		bus_;
		std::string		database_;
		bool			bit_numbering_inverted_;
		bool			enabled_;
	public:
		std::string mapping_name() const;
		std::string bus() const;
		std::string database() const;
		bool bit_numbering_inverted() const;
		bool enabled() const;
		
		void from_json(const nlohmann::json& j);
		nlohmann::json to_json() const;
	};

	void to_json(nlohmann::json& j, const mapping& p);
	void from_json(const nlohmann::json& j, mapping& p);
}