File: convertbool2booltristate.h

package info (click to toggle)
ksimus-boolean 0.3.6-13
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,296 kB
  • ctags: 768
  • sloc: sh: 8,092; cpp: 4,980; perl: 2,029; makefile: 102
file content (101 lines) | stat: -rw-r--r-- 2,890 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/***************************************************************************
                          convertbool2booltristate.h  -  description
                             -------------------
    begin                : Sun Jun 30 2002
    copyright            : (C) 2002 by Rasmus Diekenbrock
    email                : ksimus@gmx.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CONVERTBOOL2BOOLTRISTATE_H
#define CONVERTBOOL2BOOLTRISTATE_H

// C-Includes

// QT-Includes

// KDE-Includes

// Project-Includes
#include "ksimus/component.h"
#include "ksimus/compview.h"


// Forward declaration
class ConnectorBoolIn;
class ConnectorBoolTristate;
class ComponentControlBlock;
class ComponentLayout;



namespace KSimLibBoolean
{



/**Converter from boolean to boolean tristate
  *@author Rasmus Diekenbrock
  */

const ComponentInfo * getConvertBool2BoolTristateInfo();

class ConvertBool2BoolTristate : public Component
{

	Q_OBJECT

public:
	ConvertBool2BoolTristate(CompContainer * container, const ComponentInfo * ci);
	~ConvertBool2BoolTristate();
	
	/** Resets the component state. */
	virtual void reset();
	
	/** Executes the simulation of this component */
	virtual void calculate();

	ConnectorBoolIn * getInputDataIn() const { return m_connDataIn; };
	ConnectorBoolIn * getInputActiveIn() const { return m_connActiveIn; };
	ConnectorBoolTristate * getOutput() const { return m_connOut; };
	
private:
	ConnectorBoolIn * m_connDataIn;
	ConnectorBoolIn * m_connActiveIn;
	ConnectorBoolTristate * m_connOut;
	bool m_lockRecursion;

};

//###############################################################

class ConvertBool2BoolTristateView : public CompView
{
public:
	ConvertBool2BoolTristateView(ConvertBool2BoolTristate * comp, eViewType viewType);
	
	virtual void draw(QPainter * p);

	ConvertBool2BoolTristate * getConverter() const { return (ConvertBool2BoolTristate*) getComponent(); };

	ComponentControlBlock * getControlBlock() const { return m_ctrlBlock; };
	ComponentLayout * getComponentLayout() const { return m_layout; };

private:
	ComponentControlBlock * m_ctrlBlock;
	ComponentLayout * m_layout;
};

//###############################################################

} //namespace KSimLibBoolean

#endif