degate  0.1.2
ProjectExporter.h
Go to the documentation of this file.
00001 /* -*-c++-*-
00002 
00003  This file is part of the IC reverse engineering tool degate.
00004 
00005  Copyright 2008, 2009, 2010 by Martin Schobert
00006 
00007  Degate is free software: you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by
00009  the Free Software Foundation, either version 3 of the License, or
00010  any later version.
00011 
00012  Degate is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU General Public License for more details.
00016 
00017  You should have received a copy of the GNU General Public License
00018  along with degate. If not, see <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00022 #ifndef __PROJECTEXPORTER_H__
00023 #define __PROJECTEXPORTER_H__
00024 
00025 #include <degate.h>
00026 #include <XMLExporter.h>
00027 #include <Project.h>
00028 
00029 #include <stdexcept>
00030 
00031 namespace degate {
00032 
00033   /**
00034    * The ProjectExporter exports a degate project.
00035    *
00036    */
00037 
00038   class ProjectExporter : public XMLExporter {
00039 
00040   private:
00041 
00042     void set_project_node_attributes(xmlpp::Element* prj_elem, Project_shptr prj);
00043 
00044     void add_grids(xmlpp::Element* prj_elem, Project_shptr prj);
00045 
00046     void add_regular_grid(xmlpp::Element* grids_elem,
00047                           const RegularGrid_shptr grid,
00048                           std::string const & grid_orientation);
00049 
00050     void add_irregular_grid(xmlpp::Element* grids_elem,
00051                             const IrregularGrid_shptr grid,
00052                             std::string const & grid_orientation);
00053 
00054     void add_layers(xmlpp::Element* prj_elem,
00055                     LogicModel_shptr lmodel,
00056                     std::string const& project_dir);
00057 
00058     void add_port_colors(xmlpp::Element* prj_elem,
00059                          PortColorManager_shptr port_color_manager);
00060 
00061     void add_colors(xmlpp::Element* prj_elem, Project_shptr prj);
00062 
00063   public:
00064     ProjectExporter() {}
00065     ~ProjectExporter() {}
00066 
00067     /**
00068      * @exception InvalidPathException
00069      * @exception InvalidPointerException
00070      * @exception std::runtime_error
00071      */
00072 
00073     void export_data(std::string const& filename, Project_shptr prj);
00074 
00075     /**
00076      * @exception InvalidPathException
00077      * @exception InvalidPointerException
00078      * @exception std::runtime_error
00079      */
00080 
00081     void export_all(std::string const& project_directory, Project_shptr prj,
00082                     bool enable_oid_rewrite = true,
00083                     std::string const& project_file = "project.xml",
00084                     std::string const& lmodel_file = "lmodel.xml",
00085                     std::string const& gatelib_file = "gate_library.xml",
00086                     std::string const& rcbl_file = "rc_blacklist.xml");
00087 
00088   };
00089 
00090 }
00091 
00092 #endif