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

32 lines
561 B
C
Raw Normal View History

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