Accessing base class method

This is a discussion on Accessing base class method within the Object forums in Theory and Concepts category; Could any corba guru help me ? =Question:= How I can access method form my old library class from servant class ? i.e do something like this: class One_impl: ublic Foreign{}; void Two:doSomethingElse( One_ptr p ) { Foreign *f = dynamic_cast<Foreign *>(p); p->doSomething(); } =Details:= I have next construction: OLD LIBRARY: class Foreign { void doSomething(); } IDL: interface One {} interface Two { doSomethingElse( in One s ); } SERVANT: class One_impl : public POA_one, Foreign {} void Two:doSomethingElse( One_ptr p ) { Foreign *f = dynamic_cast<Foreign *>(p); p->doSomething(); } How I can access method Foreign::doSomething() from Two::doSomethingElse() ? ...

Go Back   Application Development Forum > Theory and Concepts > Object

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-07-2004, 03:41 AM
Dmitry Samersoff
Guest
 
Default Accessing base class method

Could any corba guru help me ?

=Question:=

How I can access method form my old library class
from servant class ?
i.e do something like this:

class One_impl:ublic Foreign{};

void Two:doSomethingElse( One_ptr p )
{
Foreign *f = dynamic_cast<Foreign *>(p);
p->doSomething();
}


=Details:=

I have next construction:

OLD LIBRARY:

class Foreign
{
void doSomething();
}

IDL:

interface One {}

interface Two
{
doSomethingElse( in One s );
}

SERVANT:

class One_impl : public POA_one, Foreign {}

void Two:doSomethingElse( One_ptr p )
{
Foreign *f = dynamic_cast<Foreign *>(p);
p->doSomething();
}

How I can access method Foreign::doSomething() from Two::doSomethingElse() ?

Now I use dirty workaround:

interface One
{
One implementation();
}

One One::implementation()
{
return this; // return pointer instead of expected _retn,
// to be able to cast it later
}

Is there a right way ?

Thank you!
DM\S
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:53 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.