🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #778

Re: Fast acces to class method

#778
From: dataman
Date: Thu, 23 Mar 2000 00:00
51 lines
2215 bytes
Thanks to all for the good answers .

--
The Aero Section : http://fly.to/TheAeroSection/
The Aero Section is a large military aircraft photo gallery.


dataman@cyberdude.com wrote:

> 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.
Technical Details
Message-ID: <38D95CD5.99581F03@cyberdude.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <38D8E693.34731AA0@cyberdude.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114592,d558f056865fc0f1
X-Google-Attributes: gid114592,public
X-Google-Thread: fdcad,d558f056865fc0f1
X-Google-Attributes: gidfdcad,public
X-Google-Thread: 109fba,d558f056865fc0f1
X-Google-Attributes: gid109fba,public
From: dataman@cyberdude.com
Subject: Re: Fast acces to class method
Date: 2000/03/23
Message-ID: <38D95CD5.99581F03@cyberdude.com>
X-Deja-AN: 601077556
Content-Transfer-Encoding: 7bit
References: <38D8E693.34731AA0@cyberdude.com>
X-Accept-Language: fr,en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@sunrise.ch
X-Trace: news1.sunrise.ch 953769131 7663 194.230.191.78 (22 Mar 2000 23:52:11 GMT)
Organization: sunrise communications ag
Mime-Version: 1.0
Reply-To: dataman@cyberdude.com
NNTP-Posting-Date: 22 Mar 2000 23:52:11 GMT
Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c++,fr.comp.lang.c++