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

33 lines
594 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:55:58 +00:00
TruthTable(std::size_t, std::size_t)
2023-01-23 11:32:18 +00:00
//: 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;
};