CppLogicGateSimulator / circuit.h
circuit.h
Raw
#pragma once

#include "node.h"
#include "gate.h"
#include <map>
#include <vector>

#ifndef CIRCUIT_H_INCLUDED
#define CIRCUIT_H_INCLUDED

class circuit
{
    public:
        //Variables:
        map <string, node> nodes;   //store the node elements
        map <string, gate*> gates;  //store the gate elements
        vector <string> inputs;     //store the node input's name to find them easily in the map
        vector <string> outputs;    //store the node output's name to find them easily in the map

        //Functions:
        void load_circuit_from_file(string inFileName);
        void load_gates_from_file(string inFileName);
        void load_nodes_from_file(string inFileName);
        void load_inputs_from_file(string inFileName);
        void showGates();
        bool are_all_outputs_computed();
        void reset();
        void compute();
};

#endif // CIRCUIT_H_INCLUDED