Init -> init

This commit is contained in:
The Coriolis Project 2008-11-17 21:55:03 +00:00
parent a9191bb93f
commit 7068f0c092
15 changed files with 77 additions and 79 deletions

View File

@ -192,7 +192,7 @@ extern "C" {
HTRY
__cs.Init ("Box.contains");
__cs.init ("Box.contains");
if ( ! PyArg_ParseTuple(args,"|O&O&:Box.contains",Converter,&arg0,Converter,&arg1) )
return ( NULL );
@ -293,7 +293,7 @@ extern "C" {
HTRY
__cs.Init ("Box.inflate");
__cs.init ("Box.inflate");
if ( ! PyArg_ParseTuple(args,"|O&O&O&O&:Box.inflate",Converter,&arg0,Converter,&arg1) )
return ( NULL );
@ -335,7 +335,7 @@ extern "C" {
HTRY
__cs.Init ("Box.merge");
__cs.init ("Box.merge");
if ( ! PyArg_ParseTuple(args,"|O&O&O&O&:Box.merge",Converter,&arg0,Converter,&arg1,Converter,&arg2,Converter,&arg3) )
return ( NULL );
@ -427,7 +427,7 @@ extern "C" {
PyObject* arg2;
PyObject* arg3;
__cs.Init ("Box.new");
__cs.init ("Box.new");
if ( ! PyArg_ParseTuple(args,"|O&O&O&O&:Box.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -139,7 +139,7 @@ extern "C" {
HTRY
__cs.Init ("Contact.new");
__cs.init ("Contact.new");
if ( ! PyArg_ParseTuple(args,"O&O&O&O&|O&O&:Contact.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -86,7 +86,7 @@ extern "C" {
HTRY
__cs.Init ( "DbU.db" );
__cs.init ( "DbU.db" );
if ( ! PyArg_ParseTuple(args,"|O&:DbU.db",Converter,&arg0) )
return ( NULL );
@ -114,7 +114,7 @@ extern "C" {
HTRY
__cs.Init ( "DbU.grid" );
__cs.init ( "DbU.grid" );
if ( ! PyArg_ParseTuple(args,"|O&:DbU.grid",Converter,&arg0) )
return ( NULL );
@ -142,7 +142,7 @@ extern "C" {
HTRY
__cs.Init ( "DbU.symbolic" );
__cs.init ( "DbU.symbolic" );
if ( ! PyArg_ParseTuple(args,"|O&:DbU.symbolic",Converter,&arg0) )
return ( NULL );

View File

@ -122,7 +122,7 @@ extern "C" {
HTRY
__cs.Init ("Horizontal.create");
__cs.init ("Horizontal.create");
if ( ! PyArg_ParseTuple(args,"O&O&O&|O&O&O&O&:Horizontal.create"
,Converter,&arg0
,Converter,&arg1

View File

@ -198,9 +198,9 @@ using namespace Hurricane;
// -------------------------------------------------------------------
// Method : "::ConverterState::AddType ()"
// Method : "::ConverterState::addType ()"
void ConverterState::AddType ( char* id
void ConverterState::addType ( char* id
, PyTypeObject* pyType
, char* name
, bool isPythonType
@ -301,11 +301,11 @@ using namespace Hurricane;
// -------------------------------------------------------------------
// Method : "::ConverterState::Init ()"
// Method : "::ConverterState::init ()"
void ConverterState::Init ( char* function, char* inheritStop ) {
void ConverterState::init ( char* function, char* inheritStop ) {
_objectIds = "";
SetFunction ( function );
setFunction ( function );
ObjectType::_inheritStop = inheritStop;
};
@ -323,7 +323,7 @@ using namespace Hurricane;
if ( PyCallable_Check(object) || baseType ) {
*pArg = object;
i = baseType->_index;
__cs.AddId ( baseType->_id );
__cs.addId ( baseType->_id );
if ( ! __cs.getTypes()[i]->_isPythonType ) {
void** member = ( (void**)( (unsigned long)object + __objectOffset ) );
@ -362,7 +362,7 @@ using namespace Hurricane;
bool ParseOneArg ( char* function, PyObject* args, string format, PyObject** arg ) {
ostringstream message;
__cs.Init ( function );
__cs.init ( function );
if ( ! PyArg_ParseTuple(args,"O&",Converter,arg) ) return ( false );
string firstArgType = ConverterState::getObjectType ( __cs.getObjectIds(), 0 );
@ -382,7 +382,7 @@ using namespace Hurricane;
bool ParseTwoArg ( char* function, PyObject* args, string format, PyObject** arg0, PyObject** arg1 ) {
ostringstream message;
__cs.Init ( function );
__cs.init ( function );
if ( ! PyArg_ParseTuple(args,"O&O&",Converter,arg0,Converter,arg1) ) return ( false );
string firstArgType = ConverterState::getObjectType ( __cs.getObjectIds(), 0 );
@ -408,9 +408,7 @@ using namespace Hurricane;
bool ParseThreeArg ( char* function, PyObject* args, string format, PyObject** arg0, PyObject** arg1, PyObject** arg2 ) {
ostringstream message;
cerr << "akecoucou2" << endl;
__cs.Init ( function );
__cs.init ( function );
if ( ! PyArg_ParseTuple(args,"O&O&O&",Converter,arg0,Converter,arg1,Converter,arg2) ) return ( false );
string firstArgType = ConverterState::getObjectType ( __cs.getObjectIds(), 0 );
@ -620,47 +618,47 @@ extern "C" {
// Identifier string can take up to 10 characters !
__cs.AddType ( "box" , &PyTypeBox , "<Box>" , false );
__cs.AddType ( "ent" , &PyTypeEntity , "<Entity>" , false );
__cs.AddType ( "cell" , &PyTypeCell , "<Cell>" , false, "ent" );
__cs.AddType ( "cellCol" , &PyTypeCellCollection , "<CellCollection>" , false );
__cs.AddType ( "comp" , &PyTypeComponent , "<Component>" , false, "ent" );
__cs.AddType ( "compCol" , &PyTypeComponentCollection, "<ComponentCollection>" , false );
__cs.AddType ( "contact" , &PyTypeContact , "<Contact>" , false, "comp" );
__cs.addType ( "box" , &PyTypeBox , "<Box>" , false );
__cs.addType ( "ent" , &PyTypeEntity , "<Entity>" , false );
__cs.addType ( "cell" , &PyTypeCell , "<Cell>" , false, "ent" );
__cs.addType ( "cellCol" , &PyTypeCellCollection , "<CellCollection>" , false );
__cs.addType ( "comp" , &PyTypeComponent , "<Component>" , false, "ent" );
__cs.addType ( "compCol" , &PyTypeComponentCollection, "<ComponentCollection>" , false );
__cs.addType ( "contact" , &PyTypeContact , "<Contact>" , false, "comp" );
// Do not change the "none" string. It's hardwired to the None object.
__cs.AddType ( "none" , Py_None->ob_type , "<None>" , true );
__cs.AddType ( "float" , &PyFloat_Type , "<Float>" , true );
__cs.AddType ( "int" , &PyInt_Type , "<Int>" , true );
__cs.AddType ( "bool" , &PyBool_Type , "<Bool>" , true );
__cs.AddType ( "string" , &PyString_Type , "<String>" , true );
__cs.AddType ( "list" , &PyList_Type , "<List>" , true );
__cs.addType ( "none" , Py_None->ob_type , "<None>" , true );
__cs.addType ( "float" , &PyFloat_Type , "<Float>" , true );
__cs.addType ( "int" , &PyInt_Type , "<Int>" , true );
__cs.addType ( "bool" , &PyBool_Type , "<Bool>" , true );
__cs.addType ( "string" , &PyString_Type , "<String>" , true );
__cs.addType ( "list" , &PyList_Type , "<List>" , true );
// Do not change the "function" string. It's hardwired to callable (function) objects.
__cs.AddType ( "function" , NULL , "<Function>" , true );
__cs.AddType ( "horiz" , &PyTypeHorizontal , "<Horizontal>" , false, "segment" );
__cs.AddType ( "inst" , &PyTypeInstance , "<Instance>" , false, "ent" );
__cs.AddType ( "instCol" , &PyTypeInstanceCollection, "<InstanceCollection>" , false );
__cs.AddType ( "layer" , &PyTypeLayer , "<Layer>" , false );
__cs.AddType ( "library" , &PyTypeLibrary , "<Library>" , false );
__cs.AddType ( "name" , &PyTypeName , "<Name>" , false );
__cs.AddType ( "ref" , &PyTypeReference , "<Reference>" , false, "ent" );
__cs.AddType ( "refCol" , &PyTypeReferenceCollection, "<ReferenceCollection>" , false );
__cs.AddType ( "net" , &PyTypeNet , "<Net>" , false, "ent" );
__cs.AddType ( "netCol" , &PyTypeNetCollection , "<NetCollection>" , false );
__cs.AddType ( "hyperNet" , &PyTypeHyperNet , "<HyperNet>" , false );
__cs.AddType ( "pin" , &PyTypePin , "<Pin>" , false, "contact" );
__cs.AddType ( "pinCol" , &PyTypePinCollection , "<PinCollection>" , false );
__cs.AddType ( "plug" , &PyTypePlug , "<Plug>" , false, "comp" );
__cs.AddType ( "plugCol" , &PyTypePlugCollection , "<PlugCollection>" , false );
__cs.AddType ( "point" , &PyTypePoint , "<Point>" , false );
__cs.AddType ( "segment" , &PyTypeSegment , "<Segment>" , false, "comp" );
__cs.AddType ( "segmentCol" , &PyTypeSegmentCollection, "<SegmentCollection>", false );
__cs.AddType ( "db" , &PyTypeDataBase , "<DataBase>" , false );
__cs.AddType ( "techno" , &PyTypeTechnology , "<Technology>" , false );
__cs.AddType ( "transfo" , &PyTypeTransformation , "<Transformation>" , false );
__cs.AddType ( "vert" , &PyTypeVertical , "<Vertical>" , false, "segment" );
__cs.AddType ( "path" , &PyTypePath , "<Path>" , false );
__cs.AddType ( "occur" , &PyTypeOccurrence , "<Occurrence>" , false );
__cs.AddType ( "occurCol" , &PyTypeOccurrenceCollection, "<OccurrenceCollection>", false );
__cs.addType ( "function" , NULL , "<Function>" , true );
__cs.addType ( "horiz" , &PyTypeHorizontal , "<Horizontal>" , false, "segment" );
__cs.addType ( "inst" , &PyTypeInstance , "<Instance>" , false, "ent" );
__cs.addType ( "instCol" , &PyTypeInstanceCollection, "<InstanceCollection>" , false );
__cs.addType ( "layer" , &PyTypeLayer , "<Layer>" , false );
__cs.addType ( "library" , &PyTypeLibrary , "<Library>" , false );
__cs.addType ( "name" , &PyTypeName , "<Name>" , false );
__cs.addType ( "ref" , &PyTypeReference , "<Reference>" , false, "ent" );
__cs.addType ( "refCol" , &PyTypeReferenceCollection, "<ReferenceCollection>" , false );
__cs.addType ( "net" , &PyTypeNet , "<Net>" , false, "ent" );
__cs.addType ( "netCol" , &PyTypeNetCollection , "<NetCollection>" , false );
__cs.addType ( "hyperNet" , &PyTypeHyperNet , "<HyperNet>" , false );
__cs.addType ( "pin" , &PyTypePin , "<Pin>" , false, "contact" );
__cs.addType ( "pinCol" , &PyTypePinCollection , "<PinCollection>" , false );
__cs.addType ( "plug" , &PyTypePlug , "<Plug>" , false, "comp" );
__cs.addType ( "plugCol" , &PyTypePlugCollection , "<PlugCollection>" , false );
__cs.addType ( "point" , &PyTypePoint , "<Point>" , false );
__cs.addType ( "segment" , &PyTypeSegment , "<Segment>" , false, "comp" );
__cs.addType ( "segmentCol" , &PyTypeSegmentCollection, "<SegmentCollection>", false );
__cs.addType ( "db" , &PyTypeDataBase , "<DataBase>" , false );
__cs.addType ( "techno" , &PyTypeTechnology , "<Technology>" , false );
__cs.addType ( "transfo" , &PyTypeTransformation , "<Transformation>" , false );
__cs.addType ( "vert" , &PyTypeVertical , "<Vertical>" , false, "segment" );
__cs.addType ( "path" , &PyTypePath , "<Path>" , false );
__cs.addType ( "occur" , &PyTypeOccurrence , "<Occurrence>" , false );
__cs.addType ( "occurCol" , &PyTypeOccurrenceCollection, "<OccurrenceCollection>", false );
PyObject* module = Py_InitModule ( "Hurricane", PyHurricane_Methods );

View File

@ -448,7 +448,7 @@ extern "C" {
PyObject* arg3;
HTRY
__cs.Init ("Instance.new");
__cs.init ("Instance.new");
if ( ! PyArg_ParseTuple(args,"O&O&O&|O&:Instance.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -108,7 +108,7 @@ extern "C" {
Name* name = NULL;
PyObject* arg0;
__cs.Init ("Name.new");
__cs.init ("Name.new");
if (!PyArg_ParseTuple(args,"|O&:Name.new",Converter,&arg0)) {
PyErr_SetString ( ConstructorError, "invalid number of parameters for Name constructor." );
return NULL;

View File

@ -250,7 +250,7 @@ extern "C" {
PyObject* arg0;
PyObject* arg1;
__cs.Init ("Occurrence.new");
__cs.init ("Occurrence.new");
if ( ! PyArg_ParseTuple(args,"|O&O&:Occurrence.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -237,7 +237,7 @@ extern "C" {
PyTransformation* pyTransf = PyObject_NEW ( PyTransformation, &PyTypeTransformation );
if ( pyTransf == NULL ) { return NULL; }
__cs.Init ("Path.getTransformation");
__cs.init ("Path.getTransformation");
if ( ! PyArg_ParseTuple(args,"|O&:Path.getTransformation",Converter,&arg0) ) return ( NULL );
HTRY
@ -321,7 +321,7 @@ extern "C" {
PyObject* arg1 = NULL;
PyPath* pyPath = NULL;
__cs.Init ("Path.new");
__cs.init ("Path.new");
if ( ! PyArg_ParseTuple(args,"|O&O&:Path.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -171,7 +171,7 @@ extern "C" {
PyObject* arg7;
PyObject* arg8;
__cs.Init ("Pin.new");
__cs.init ("Pin.new");
if (!PyArg_ParseTuple(args,"O&O&O&O&O&O&O&|O&O&:Pin.new"
, Converter, &arg0
, Converter, &arg1

View File

@ -143,7 +143,7 @@ extern "C" {
PyObject* arg0;
PyObject* arg1;
__cs.Init ("Point.create");
__cs.init ("Point.create");
if ( ! PyArg_ParseTuple(args,"|O&O&:Point.create"
,Converter,&arg0
,Converter,&arg1

View File

@ -195,7 +195,7 @@ extern "C" {
HTRY
__cs.Init ("Reference.new");
__cs.init ("Reference.new");
if ( ! PyArg_ParseTuple(args,"O&O&O&|O&:Reference.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -167,7 +167,7 @@ extern "C" {
HTRY
__cs.Init ("Transformation.getX");
__cs.init ("Transformation.getX");
if ( ! PyArg_ParseTuple(args,"|O&O&:Transformation.getX",Converter,&arg0,Converter,&arg1) )
return ( NULL );
@ -202,7 +202,7 @@ extern "C" {
HTRY
__cs.Init ("Transformation.getY");
__cs.init ("Transformation.getY");
if ( ! PyArg_ParseTuple(args,"|O&O&:Transformation.getY",Converter,&arg0,Converter,&arg1) )
return ( NULL );
@ -321,7 +321,7 @@ extern "C" {
PyObject* arg1;
Point result;
__cs.Init ("Transformation.getPoint");
__cs.init ("Transformation.getPoint");
if ( ! PyArg_ParseTuple(args,"|O&O&:Transformation.getPoint",Converter,&arg0,Converter,&arg1) )
return ( NULL );
@ -367,7 +367,7 @@ extern "C" {
PyObject* arg3;
Box result;
__cs.Init ("Transformation.getBox");
__cs.init ("Transformation.getBox");
if ( ! PyArg_ParseTuple(args,"|O&O&O&O&:Transformation.getBox"
,Converter,&arg0
,Converter,&arg1
@ -472,7 +472,7 @@ extern "C" {
HTRY
__cs.Init ("Transformation.ApplyOn");
__cs.init ("Transformation.ApplyOn");
if ( ! PyArg_ParseTuple(args,"|O&O&:Transformation.ApplyOn",Converter,&arg0,Converter,&arg1) )
return ( NULL );
@ -551,7 +551,7 @@ extern "C" {
PyObject* arg1;
PyObject* arg2;
__cs.Init ("Transformation.new");
__cs.init ("Transformation.new");
if ( ! PyArg_ParseTuple(args,"|O&O&O&:Transformation.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -117,7 +117,7 @@ extern "C" {
Vertical* vertical = NULL;
HTRY
__cs.Init ("Vertical.new");
__cs.init ("Vertical.new");
if (!PyArg_ParseTuple(args,"O&O&O&|O&O&O&O&:Vertical.new"
,Converter,&arg0
,Converter,&arg1

View File

@ -116,11 +116,11 @@ using namespace std;
public: char* getFunction () const { return ( _function ); };
public: int getSize () const { return ( _objectIds.size() ); };
public: const ObjectTypeVector& getTypes () const { return ( _types ); };
public: void AddObject ( PyObject* object ) { _objectIds += getObjectId ( object ); };
public: void AddId ( char* id ) { _objectIds += ":"; _objectIds += id; };
public: void SetFunction ( char* function ) { _function = function; };
public: void Init ( char* function, char* inheritStop="comp" );
public: void AddType ( char* id, PyTypeObject* pyType, char* name, bool isPythonType, char* idBase="" );
public: void addObject ( PyObject* object ) { _objectIds += getObjectId ( object ); };
public: void addId ( char* id ) { _objectIds += ":"; _objectIds += id; };
public: void setFunction ( char* function ) { _function = function; };
public: void init ( char* function, char* inheritStop="comp" );
public: void addType ( char* id, PyTypeObject* pyType, char* name, bool isPythonType, char* idBase="" );
public: static string getObjectType ( string objectsTypes, unsigned n );
};