Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: calling "af...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 45758 of 48020
Post > Topic >>

Re: calling "after return"...?

by Ben Bacarisse <ben.usenet@[EMAIL PROTECTED] > May 5, 2008 at 03:42 PM

".rhavin grobert" <clqrq@[EMAIL PROTECTED]
> writes:

> [insert ya favorite greetin' here;-)]
>
> guess you have the following cl*****...
> ___________________________________
> class  {
>   //..a couple of methods ...//
> };
>
> class A {
> public:
>   //...//
>   B* GetB() // <- this we'll talk about
> private:
>   B* m_pB;
> };
>
> A::GetB() {
>   //..some code..//
>   return m_pB;
> };
> ___________________________________
>
> when some does a...
>
> A.GetB()->AMethodOfB();
>
> ... and you want some code be executed before B::AMethodOfB() is
> called, you simply pack it into A::GetB()'s body before the return.
> But what do yuo do, if you want to execute some code _after_ B's
> method is executed,

Obviously you put it after the call you've just written above.  Now,
since this is obvious there must be some confusion...

> e.g. when the callstack - after completing the
> call into B - returns back into A::GetB()?

And here it is.  That does not happen.  The A.GetB() call is entirely
over by the time AMethodOfB is called.

-- 
Ben.
 




 6 Posts in Topic:
calling "after return"...?
".rhavin grobert&quo  2008-05-05 06:03:07 
Re: calling "after return"...?
Branimir Maksimovic <b  2008-05-05 07:28:40 
Re: calling "after return"...?
gw7rib@[EMAIL PROTECTED]   2008-05-05 07:31:11 
Re: calling "after return"...?
Ben Bacarisse <ben.use  2008-05-05 15:42:18 
Re: calling "after return"...?
pjb@[EMAIL PROTECTED] (P  2008-05-05 16:53:12 
Re: calling "after return"...?
"Eric.Malenfant@[EMA  2008-05-05 07:56:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 8:53:05 CDT 2008.