Re: [Evolution-hackers] [Camel] How can I get a reference to the store class from another class?



On Mon, 2005-10-10 at 12:18 +0200, Jules Colding wrote:
> On Mon, 2005-10-10 at 12:05 +0200, Jules Colding wrote:
> > > Transport doesn't derive from Store, they both derive from Service.
> > > 
> > > So if you want to share the connect() implementation from both classes,
> > > then it must be implemented in a sharable manner, and not separately.
> 
> Another confusing item is that groupwise_send_to() is acquiring a
> reference to the groupwise store (~line 164 in
> camel-groupwise-transport.c):

This is precisely the same as the cat calling mouse.eat().

Note that it is getting a completely new object.

It's private peeking is 'ok' since it shares that private knowledge.  It
doesn't make it good though.

> ######## snip #######
> 	CamelStore *store = NULL;
> 	CamelGroupwiseStorePrivate *priv = NULL;
> 	CamelService *service = CAMEL_SERVICE(transport);
> 
>         < snip >
> 
> 	store = camel_session_get_store (service->session, url, ex );
> 	groupwise_store = CAMEL_GROUPWISE_STORE (store);
> 	priv = groupwise_store->priv;
> ######## snip #######
> 
> The transport should be able to invoke overloaded store methods, such as
> connect(), on this reference, right?

They can invoke any of the PUBLIC ENTRY POINTS, yes.

But you can't call store.parent_class.connect(on the transport), since
they are not the same object.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]