Represents a gate in a circuit. More...
Public Types | |
typedef std::vector< gate > | vector |
Vector type of gates. More... | |
typedef unsigned | line |
Type for accessing the line (line index) More... | |
typedef std::set< line > | line_container |
Container for storing lines. More... | |
typedef boost::transform_iterator < transform_line, boost::filter_iterator < filter_line, line_container::iterator > > | iterator |
Mutable Iterator for iterating through control or target lines. More... | |
typedef boost::transform_iterator < transform_line, boost::filter_iterator < filter_line, line_container::const_iterator > > | const_iterator |
Constant Iterator for iterating through control or target lines. More... | |
Public Member Functions | |
gate () | |
Default constructor. More... | |
gate (const gate &other) | |
Copy Constructor. More... | |
virtual | ~gate () |
Default deconstructor. More... | |
gate & | operator= (const gate &other) |
Assignment operator. More... | |
virtual const_iterator | begin_controls () const |
Start iterator for accessing control lines. More... | |
virtual const_iterator | end_controls () const |
End iterator for accessing control lines (const). More... | |
virtual iterator | begin_controls () |
Start iterator for accessing control lines (non-const). More... | |
virtual iterator | end_controls () |
End iterator for accessing control lines (non-const). More... | |
virtual const_iterator | begin_targets () const |
Start iterator for accessing target lines (const). More... | |
virtual const_iterator | end_targets () const |
End iterator for accessing target lines (const). More... | |
virtual iterator | begin_targets () |
Start iterator for accessing target lines (const). More... | |
virtual iterator | end_targets () |
End iterator for accessing target lines (non-const). More... | |
virtual unsigned | size () const |
Returns the number of control and target lines as sum. More... | |
virtual void | add_control (line c) |
Adds a control line to the gate. More... | |
virtual void | remove_control (line c) |
Remove control line to the gate. More... | |
virtual void | add_target (line l) |
Adds a target to the desired line. More... | |
virtual void | remove_target (line l) |
Removes a target from the desired line. More... | |
virtual void | set_type (const boost::any &t) |
Sets the type of the target line(s) More... | |
virtual const boost::any & | type () const |
Returns the type of the target line(s) More... | |
Friends | |
class | filtered_gate |
Represents a gate in a circuit.
typedef boost::transform_iterator<transform_line, boost::filter_iterator<filter_line, line_container::const_iterator> > const_iterator |
Constant Iterator for iterating through control or target lines.
typedef boost::transform_iterator<transform_line, boost::filter_iterator<filter_line, line_container::iterator> > iterator |
Mutable Iterator for iterating through control or target lines.
typedef unsigned line |
Type for accessing the line (line index)
typedef std::set<line> line_container |
Container for storing lines.
gate | ( | ) |
Default constructor.
Initializes private data
Copy Constructor.
Initializes private data and copies gate
other | Gate to be assigned |
|
virtual |
Default deconstructor.
Clears private data
|
virtual |
Adds a control line to the gate.
c | control line to add |
Reimplemented in filtered_gate.
|
virtual |
|
virtual |
Start iterator for accessing control lines.
Returns The start iterator of the line_container for accessing control lines.
Reimplemented in filtered_gate.
|
virtual |
Start iterator for accessing control lines (non-const).
Returns The start iterator of the line_container for accessing lines (non-const).
Reimplemented in filtered_gate.
|
virtual |
Start iterator for accessing target lines (const).
Returns The start iterator of the line_container for accessing target lines (const).
Reimplemented in filtered_gate.
|
virtual |
Start iterator for accessing target lines (const).
Returns The start iterator of the line_container for accessing target lines (const).
Reimplemented in filtered_gate.
|
virtual |
End iterator for accessing control lines (const).
Returns The end iterator of the line_container for accessing control lines (const).
Reimplemented in filtered_gate.
|
virtual |
End iterator for accessing control lines (non-const).
Returns the end iterator of the line_container for accessing control lines (non-const).
Reimplemented in filtered_gate.
|
virtual |
End iterator for accessing target lines (const).
Returns The end iterator of the line_container for accessing target lines (const).
Reimplemented in filtered_gate.
|
virtual |
End iterator for accessing target lines (non-const).
Returns The start iterator of the line_container for accessing target lines (non-const).
Reimplemented in filtered_gate.
Assignment operator.
other | Gate to be assigned |
|
virtual |
Remove control line to the gate.
c | control line to remove |
Reimplemented in filtered_gate.
|
virtual |
Removes a target from the desired line.
l | target line |
Reimplemented in filtered_gate.
|
virtual |
Sets the type of the target line(s)
t | target type |
Reimplemented in filtered_gate.
|
virtual |
Returns the number of control and target lines as sum.
This method returns the number of control and target lines as sum and can be used for e.g. calculating costs.
Reimplemented in filtered_gate.
|
virtual |