Public Member Functions | Private Types | Private Member Functions | Private Attributes

# ShLogic Class Reference

Implements a simple logic gate. More...

`#include <shlogic.h>`

Inheritance diagram for ShLogic:
[legend]
Collaboration diagram for ShLogic:
[legend]

List of all members.

## Public Member Functions
| ShLogic ()
| Constructor of ShLogic.
virtual | ~ShLogic ()
virtual bool | init (QString param)
| Initialization of the plug-in.
virtual void | updatePins (const QList< ShPin > &pins)
| Updates a list of gate inputs.
virtual void | processMessage (ShMessagePtr message)
| Processes incoming messages (input changes).
## Private Types
enum | GateType { gtAnd, gtNand, gtOr, gtNor, gtXor }
## Private Member Functions
void | updateOutput ()
| Updates the output of the logic gate.
## Private Attributes
GateType | mGateType
QMap< QString, bool > | mInputs
bool | mOutput

## Detailed Description

Implements a simple logic gate.

Definition at line 32 of file shlogic.h.

## Member Enumeration Documentation

enum ShLogic::GateType`[private]`

Enumerator:

  gtAnd |
  gtNand |
  gtOr |
  gtNor |
  gtXor |

Definition at line 45 of file shlogic.h.

## Constructor & Destructor Documentation

ShLogic::ShLogic | ( |  | ) |

Constructor of ShLogic.

Definition at line 25 of file shlogic.cpp.

References mGateType, and mOutput.

virtual ShLogic::~ShLogic | ( |  | ) | `[inline, virtual]`

Definition at line 39 of file shlogic.h.

## Member Function Documentation

bool ShLogic::init | ( | QString | param | ) | `[virtual]`

Initialization of the plug-in.

Parameters:

  | param | Defines a desired logic function

Returns:
  true if the plug-in has been initialized successfully

Implements ShObject.

Definition at line 37 of file shlogic.cpp.

References mGateType.

void ShLogic::processMessage | ( | ShMessagePtr | message | ) | `[virtual]`

Processes incoming messages (input changes).

Parameters:

  | message | Shared pointer to the message

Definition at line 110 of file shlogic.cpp.

References ShObjectHelper::ackMessage(), ShObjectHelper::errorMessage(), mInputs, mOutput, ShObjectHelper::outputUpdated(), and updateOutput().

Here is the call graph for this function:

void ShLogic::updateOutput | ( |  | ) | `[private]`

Updates the output of the logic gate.

Definition at line 71 of file shlogic.cpp.

References gtAnd, gtNand, gtNor, gtOr, gtXor, mGateType, mInputs, mOutput, and ShObjectHelper::outputUpdated().

Referenced by processMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

void ShLogic::updatePins | ( | const QList< ShPin > & | pins | ) | `[virtual]`

Updates a list of gate inputs.

Parameters:

  | pins | List of pins belonging to plug-in

Implements ShObject.

Definition at line 56 of file shlogic.cpp.

References ShPin::isInput(), mInputs, and ShPin::signal().

Here is the call graph for this function:

## Member Data Documentation

GateType ShLogic::mGateType`[private]`

Definition at line 52 of file shlogic.h.

Referenced by init(), ShLogic(), and updateOutput().

QMap<QString,bool> ShLogic::mInputs`[private]`

Definition at line 53 of file shlogic.h.

Referenced by processMessage(), updateOutput(), and updatePins().

bool ShLogic::mOutput`[private]`

Definition at line 54 of file shlogic.h.

Referenced by processMessage(), ShLogic(), and updateOutput().

The documentation for this class was generated from the following files:

- shlogic/shlogic.h
- shlogic/shlogic.cpp

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends