Every NOX component (which is a class that inherits from Component) holds a 
pointer to its context in the ctxt field.  This happens through Component's 
constructor.

So within your component, you should be able to do something like...
... = ctxt->get_by_name("Some Other Component Name");
.. and get a pointer to the named component (you'll need to cast it to the 
appropriate type).

But I'm not entirely sure I understand what you're trying to do.  You say 
you're trying to get an instance of an application and send it to another 
controller, and my first response is, "You can't do that," so hopefully I'm 
just misunderstanding. :)

-- Murphy

On Friday, June 03, 2011 11:02:23 AM Paulo César wrote:
> Hi,
> 
> I am trying to get a instance of an application and send it to another
> controller.
> 
> The class Context seems to provide what I was looking for:
> > class Context {
> > public:
> > ...
> > 
> >     /* Find a component and return a pointer to its instance.  Returns
> >     
> >        0 if not found. */
> >     
> >     virtual Component* get_by_name(const Component_name&) const = 0;
> > 
> > ...
> > }
> 
> But I am having a problem to use Context as a parameter to a function of my
> class.
> 
> Did anyone try anything similar? (Use the class Context or get a instance
> of a component)
> 
> Best regards.
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to