Article View: alt.comp.lang.learn.c-c++
Article #772Re: Fast acces to class method
From: sj
Date: Wed, 22 Mar 2000 00:00
Date: Wed, 22 Mar 2000 00:00
49 lines
1836 bytes
1836 bytes
dataman@cyberdude.com wrote in message <38D8E693.34731AA0@cyberdude.com>...
>What is the fastest way for accessing a member in a class.
>
>DATA is a structure;
>
>class A
>{
> public:
> //directly by having access to the member ?
> DATA data;
>
> //by return value
> DATA GetData()
> {
> return data;
> }
>
> //by reference
> void GetData(DATA& d)
> {
> d=data;
> }
>
> //by pointer
> void GetData(DATA* pD)
> {
> *pData=data;
> }
>}
>
>I am programing a real time application (a 3D game) , that access very
>often the DATA (several times per second) in the class A .
>So, i need the fastest access to it , even if the OOP may suffer (like
>accessing directly DATA without a method) .
>
>You can give me the + and - of every method (speed , memory ..etc.) , so
>i can have a best look.
>
>Thank you.
>
>--
>The Aero Section : http://fly.to/TheAeroSection/
>The Aero Section is a large military aircraft photo gallery.
>
>
You could make the calls 'inline'.
Technical Details
Message-ID:
<8bapbr$lt6@news.or.intel.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38D8E693.34731AA0@cyberdude.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,d558f056865fc0f1 X-Google-Attributes: gid109fba,public X-Google-Thread: fdcad,d558f056865fc0f1 X-Google-Attributes: gidfdcad,public X-Google-Thread: 114592,d558f056865fc0f1 X-Google-Attributes: gid114592,public From: "sj" <sj@a.com> Subject: Re: Fast acces to class method Date: 2000/03/22 Message-ID: <8bapbr$lt6@news.or.intel.com> X-Deja-AN: 600891132 References: <38D8E693.34731AA0@cyberdude.com> Organization: Intel Corporation X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c++,fr.comp.lang.c++