specification_processor Class Reference

Implementation of revlib_processor to construct a reversible_truth_table. More...

Inheritance diagram for specification_processor:
revlib_processor

List of all members.

Public Member Functions

 specification_processor (binary_truth_table &spec)
 Default constructor.
virtual ~specification_processor ()
 Default deconstructor.

Protected Member Functions

virtual void on_inputs (std::vector< std::string >::const_iterator first, std::vector< std::string >::const_iterator last) const
 Called when parsing .inputs command.
virtual void on_outputs (std::vector< std::string >::const_iterator first, std::vector< std::string >::const_iterator last) const
 Called when parsing .outputs command.
virtual void on_constants (std::vector< constant >::const_iterator first, std::vector< constant >::const_iterator last) const
 Called when parsing the .constants command.
virtual void on_garbage (std::vector< bool >::const_iterator first, std::vector< bool >::const_iterator last) const
 Called when parsing .garbage command.
virtual void on_truth_table_line (unsigned line_index, const std::vector< boost::optional< bool > >::const_iterator first, const std::vector< boost::optional< bool > >::const_iterator last) const
 Called when a truth table line is parsed.

Detailed Description

Implementation of revlib_processor to construct a reversible_truth_table.

This class inherits from revlib_processor and constructs a reversible_truth_table when parsing a specification file.

For convinience the function read_specification(reversible_truth_table&, const std::string&, std::string*) wraps the use of this class to read truth tables from a file.

Author:
RevKit
Since:
1.0

Constructor & Destructor Documentation

specification_processor ( binary_truth_table spec  )  [explicit]

Default constructor.

Initializes private data

Parameters:
spec An empty reversible_truth_table which will be constructed and filled with entries while parsing the file
Author:
RevKit
Since:
1.0
virtual ~specification_processor (  )  [virtual]

Default deconstructor.

Clears private data

Author:
RevKit
Since:
1.0

Member Function Documentation

virtual void on_constants ( std::vector< constant >::const_iterator  first,
std::vector< constant >::const_iterator  last 
) const [protected, virtual]

Called when parsing the .constants command.

This method is called when a .constants command is parsed. The constant in a std::vector can be accessed via their first and last iterator. A optional boolean value indicates whether the line is constant or not and in case it is constant, which constant line is represented.

Parameters:
first Begin iterator of constants vector
last End iterator of constants vector
Author:
RevKit
Since:
1.0

Reimplemented from revlib_processor.

virtual void on_garbage ( std::vector< bool >::const_iterator  first,
std::vector< bool >::const_iterator  last 
) const [protected, virtual]

Called when parsing .garbage command.

This method is called when a .garbage command is parsed. The garbage in a std::vector can be accessed via their first and last iterator. A boolean value indicates whether the line has a garbage output or not.

Parameters:
first Begin iterator of garbage vector
last End iterator of garbage vector
Author:
RevKit
Since:
1.0

Reimplemented from revlib_processor.

virtual void on_inputs ( std::vector< std::string >::const_iterator  first,
std::vector< std::string >::const_iterator  last 
) const [protected, virtual]

Called when parsing .inputs command.

This method is called when a .inputs command is parsed. The inputs in a std::vector can be accessed via their first and last iterator.

Parameters:
first Begin iterator of inputs vector
last End iterator of inputs vector
Author:
RevKit
Since:
1.0

Reimplemented from revlib_processor.

virtual void on_outputs ( std::vector< std::string >::const_iterator  first,
std::vector< std::string >::const_iterator  last 
) const [protected, virtual]

Called when parsing .outputs command.

This method is called when a .outputs command is parsed. The outputs in a std::vector can be accessed via their first and last iterator.

Parameters:
first Begin iterator of outputs vector
last End iterator of outputs vector
Author:
RevKit
Since:
1.0

Reimplemented from revlib_processor.

virtual void on_truth_table_line ( unsigned  line_index,
const std::vector< boost::optional< bool > >::const_iterator  first,
const std::vector< boost::optional< bool > >::const_iterator  last 
) const [protected, virtual]

Called when a truth table line is parsed.

This method is called when a truth table line is parsed. A truth table line is parsed in a specification file.

The truth table line is given as first and last iterator over boost::optional<bool> values and as additional parameter the corresponding truth table line is given.

Parameters:
line_index The corresponding truth table line
first Begin iterator over truth table output value
last End iterator over truth table output value
Author:
RevKit
Since:
1.0

Reimplemented from revlib_processor.


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

Generated on Fri Jul 2 07:50:42 2010 for by doxygen 1.6.3