Click here to Skip to main content
15,885,216 members
Articles / Web Development / HTML

Circuit Engine

Rate me:
Please Sign up or sign in to vote.
4.93/5 (103 votes)
18 Oct 2018GPL355 min read 248.1K   8.6K   212  
A System for Simulation and Analysis of Logic Circuits
/*
This file is part of Circuit Engine.
 
Circuit Engine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
 
Circuit Engine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with Circuit Engine.  If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------
	BBNode.h :  The atomic unit of BreadBoard class
				to memorize and check the connections between
				Circuit Elements.
*/

#pragma once
#include "Gate.h"

class BBNode
{
	Gate *gate_info;
	int node_map_index; // -1 means it's not plugged to any hole on BreadBoard.
    BBNode *next_hole;

public:

	BBNode();
	void SetGateInfo(Gate *new_gate_info);
	void SetNextHole(BBNode *new_next_hole);
	void SetNodeMapIndex(int new_node_map_index);
	Gate *GetGateInfo(void);
	BBNode *GetNextHole(void);
	int GetNodeMapIndex(void);
};

BBNode::BBNode()
{
	gate_info = NULL;
	next_hole = NULL;
	node_map_index = -1;
}
void BBNode::SetGateInfo(Gate *new_gate_info)
{
    gate_info = new_gate_info;
}
void BBNode::SetNextHole(BBNode *new_next_hole)
{
	next_hole = new_next_hole;
}
void BBNode::SetNodeMapIndex(int new_node_map_index)
{
    node_map_index = new_node_map_index;
}
Gate *BBNode::GetGateInfo(void)
{
	return gate_info;
}
BBNode *BBNode::GetNextHole(void)
{
    return next_hole;
}
int BBNode::GetNodeMapIndex(void)
{
	return node_map_index;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Engineer Siemens
Turkey Turkey
I've graduated from computer engineering department in 2004 July, and developed the Circuit Engine as my graduation project at Eastern Mediterranean University (EMU). I've also graduated from MBA, Istanbul University in 2008 February. From 2004 until now, I've developed many web sites (B2B, B2C). Currently work for Siemens AG (http://siemens.com/ingenuityforlife) as a R&D Engineer (IoT) and I still continue to develop my personal projects about encryption algorithms, maths, OpenGL, Stock Exchange Market Analyses and Real-time Systems, MultiThreaded Applications and Web Solutions (mostly ASP.NET C#, JQuery/JS, MVC, WinForms, Win/Web Services, T-SQL and less PHP, ASP, MySQL and some possible other methods about problem solving if necessary). Also personal profession of photography : https://www.instagram.com/egldgn/


Circuit Engine base URL : https://sites.google.com/view/circuitengine


Comments and Discussions