From d5d17466d4c12ab7789b1612f0cc6ec901cf01ac Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Sun, 30 Nov 2008 20:33:42 +0000 Subject: [PATCH] small modifications in isobar --- hurricane/src/isobar/PyEntity.cpp | 1 + hurricane/src/isobar/PyLibrary.cpp | 18 +++++++++++------- hurricane/src/isobar/PyNet.cpp | 1 + hurricane/src/isobar/PyPath.cpp | 5 +++-- hurricane/src/isobar/PyReference.cpp | 4 ++-- hurricane/src/isobar/hurricane/isobar/PyCell.h | 12 ++++-------- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/hurricane/src/isobar/PyEntity.cpp b/hurricane/src/isobar/PyEntity.cpp index 47dfd03b..5b1be577 100644 --- a/hurricane/src/isobar/PyEntity.cpp +++ b/hurricane/src/isobar/PyEntity.cpp @@ -49,6 +49,7 @@ // | | // x-----------------------------------------------------------------x +#include "hurricane/Cell.h" #include "hurricane/isobar/PyNet.h" #include "hurricane/isobar/PyLayer.h" #include "hurricane/isobar/PyPoint.h" diff --git a/hurricane/src/isobar/PyLibrary.cpp b/hurricane/src/isobar/PyLibrary.cpp index 583f5e7b..31f56917 100644 --- a/hurricane/src/isobar/PyLibrary.cpp +++ b/hurricane/src/isobar/PyLibrary.cpp @@ -179,20 +179,24 @@ extern "C" { PyObject* arg0; PyObject* arg1; Library* library = NULL; - if (ParseTwoArg("Library.new", args, ":db:name", &arg0, &arg1)) { - HTRY + + HTRY + __cs.init ("Library.new"); + if (!PyArg_ParseTuple(args,"O&O&:Library.new", Converter, &arg0, Converter, &arg1)) { + PyErr_SetString ( ConstructorError, "invalid number of parameters for Library constructor." ); + return NULL; + } + if (__cs.getObjectIds() == ":db:name") { DataBase* db = PYDATABASE_O(arg0); library = Library::create(db, *PYNAME_O(arg1)); - HCATCH - } else if (ParseTwoArg("Library.new", args, ":library:name", &arg0, &arg1)) { - HTRY + } else if (__cs.getObjectIds() == ":library:name") { Library* masterLibrary = PYLIBRARY_O(arg0); library = Library::create(masterLibrary, *PYNAME_O(arg1)); - HCATCH } else { - PyErr_SetString(ConstructorError, "wrong arguments"); + PyErr_SetString ( ConstructorError, "invalid number of parameters for Library constructor." ); return NULL; } + HCATCH return PyLibrary_Link ( library ); } diff --git a/hurricane/src/isobar/PyNet.cpp b/hurricane/src/isobar/PyNet.cpp index 36e8c4b9..0c100d13 100644 --- a/hurricane/src/isobar/PyNet.cpp +++ b/hurricane/src/isobar/PyNet.cpp @@ -61,6 +61,7 @@ #include "hurricane/isobar/PyComponentCollection.h" #include "hurricane/isobar/PyPinCollection.h" +#include "hurricane/Cell.h" #include "hurricane/NetExternalComponents.h" using namespace Hurricane; diff --git a/hurricane/src/isobar/PyPath.cpp b/hurricane/src/isobar/PyPath.cpp index de8ba464..d7020d4c 100644 --- a/hurricane/src/isobar/PyPath.cpp +++ b/hurricane/src/isobar/PyPath.cpp @@ -49,6 +49,9 @@ // | | // x-----------------------------------------------------------------x +#include "hurricane/Cell.h" +using namespace Hurricane; + #include "hurricane/isobar/PyTransformation.h" #include "hurricane/isobar/PyName.h" #include "hurricane/isobar/PyPath.h" @@ -56,10 +59,8 @@ #include "hurricane/isobar/PyInstance.h" #include "hurricane/isobar/PyInstanceCollection.h" - namespace Isobar { -using namespace Hurricane; extern "C" { diff --git a/hurricane/src/isobar/PyReference.cpp b/hurricane/src/isobar/PyReference.cpp index 0d11e4b3..53461b98 100644 --- a/hurricane/src/isobar/PyReference.cpp +++ b/hurricane/src/isobar/PyReference.cpp @@ -50,7 +50,8 @@ // x-----------------------------------------------------------------x - +#include "hurricane/Cell.h" +using namespace Hurricane; #include "hurricane/isobar/PyReference.h" #include "hurricane/isobar/PyPoint.h" @@ -61,7 +62,6 @@ namespace Isobar { -using namespace Hurricane; extern "C" { diff --git a/hurricane/src/isobar/hurricane/isobar/PyCell.h b/hurricane/src/isobar/hurricane/isobar/PyCell.h index caf037cb..98f21050 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyCell.h +++ b/hurricane/src/isobar/hurricane/isobar/PyCell.h @@ -59,14 +59,13 @@ #include "hurricane/isobar/PyEntity.h" -#include "hurricane/Cell.h" +namespace Hurricane { + class Cell; +} namespace Isobar { -using namespace Hurricane; - - extern "C" { @@ -101,7 +100,4 @@ extern "C" { } // End of Isobar namespace. - - - -# endif +#endif