stuff-from-scratch/plugins/circuits/src/TruthTable.h

33 lines
627 B
C
Raw Normal View History

2023-01-20 16:47:39 +00:00
#pragma once
#include <map>
#include <vector>
class TruthTable
{
public:
2023-01-23 11:32:18 +00:00
using TableData = std::map<std::vector<bool>, std::vector<bool> >;
2023-01-20 16:47:39 +00:00
2023-01-23 11:32:18 +00:00
TruthTable(std::size_t numInputColumns, std::size_t numOutputColumns)
//: mNumInputColumns(numInputColumns),
// mNumOutputColumns(numOutputColumns)
{
2023-01-20 16:47:39 +00:00
2023-01-23 11:32:18 +00:00
}
2023-01-20 16:47:39 +00:00
2023-01-23 11:32:18 +00:00
void setTable(const TableData& data)
{
mTable = data;
}
2023-01-20 16:47:39 +00:00
2023-01-23 11:32:18 +00:00
static TruthTable getAndTruthTable();
2023-01-20 16:47:39 +00:00
2023-01-23 11:32:18 +00:00
static const TruthTable::TableData AND_TRUTH_TABLE;
2023-01-20 16:47:39 +00:00
private:
2023-01-23 11:32:18 +00:00
//std::size_t mNumInputColumns{ 0 };
//std::size_t mNumOutputColumns{ 0 };
2023-01-20 16:47:39 +00:00
2023-01-23 11:32:18 +00:00
TableData mTable;
};