[gdal-dev] Re: C/C++ Divide

Stephane Villeneuve svilleneuve at c...
Thu Nov 19 00:03:35 EST 1998


Hi,

I agree with Daniel, using C++ give many avantages, and a C library is a
MUST:

My idea is :

Use a function (same type of a Promote() to select the object)

EX:

int main()
{
FILE *fp = GDALOpenFile("Toto","r+");
FILE *fp2 = GDALOpenFile("Toto2", "r+");

Promote(fp);
hType1 = GDALGetRasterXSize();
Promote(fp2);
hType2 = GDALGetRasterSize();
}

int GDALGetRasterSize()
{
poCurrent->GetRasterSize();
}

void PromoteFile(fp)
{
static GDALDataset *poCurrent = NULL;
poCurrent = (ANYTHING *)fp->GetCPPObject();

or could use a strcture in a chain list.

}

By this way, you don't need to add a extra parameter for the C call.
If you transfere information between 2 file you will add many calls to
promote() :-(((((

Brian Koehler wrote:
> Brian's suggestion to have a tool that generates the cover functions
> automatically could be nice... and actually Stephane Villeneuve told me
> that he was interested by compilers and pre-processors... I'll CC: this
> message to him, and he may be interested in looking at this?!?

I don't think that it's very hard to create cover functions in other
languages, 
Jacket functions should call only the C function. I'am sure it will be
possible to create a parser to do that.
Is some one already call C functions in a other language (Not me) ????


BTW, I add my name in the mailing list.


regards,
stephane 

Long live to GDAL.
__________________
Stephane Villeneuve
Software Analyst
svilleneuve at c...


------------------------------------------------------------------------
Free Web-based e-mail groups -- http://www.eGroups.com





More information about the Gdal-dev mailing list