Boost logo

Boost Users :

From: Lukasz (lkudra_at_[hidden])
Date: 2007-06-26 10:34:44


That's very kind, but i already tried out my idea and it works :) Variant
basically allowed me to keep a list of all my events of different types,
which is exactly what i needed. That, combined with my original "derived
helper", and the visitor allows me to get pretty much everything i needed.

Thanks again,

Lukasz K.
 

Ovanes Markarian wrote:
>
>
> If you like, prepare me some simple example and I can correct it or help
> you at this point.
>
>
> With Kind Regards,
>
> Ovanes Markarian
>
> On Tue, June 26, 2007 14:56, Lukasz wrote:
>>
>> You summed it up very well with the first paragraph. I've been trying to
>> template this from the beginning, but it just wouldn't fit into the
>> design.
>> However, i think i'll be able to use variant within one of my maps to
>> store
>> the "real" type of the event which should work perfectly for my needs.
>> Thanks for all the input... it really helped to get some ideas together
>> and
>> variant will probably do the trick (but i still have to fiddle some more
>> with the idea).
>>
>> Thanks again.
>>
>> Lukasz K.
>>
>>
>> Ovanes Markarian wrote:
>>>
>>>
>>> My idea is based on fact that you (program developer or another
>>> developer)
>>> know what is going to
>>> be send. What you are trying to do is erasing the type to some base and
>>> that would not work.
>>>
>>> So you send event must handle derived type and put it correctly to
>>> variant. A possible solution
>>> would be:
>>>
>>> template<class EventType_>
>>> void sendEvent(EventType_ const& ev)
>>> {
>>> m_eventContainer = ev; //<- now compiler knows exactly the type of ev
>>> m_derivedHelper->dispatchEvent(&m_eventContainer);
>>> }
>>>
>>>
>>> Best Regards,
>>> Ovanes
>>>
> [...]
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>

-- 
View this message in context: http://www.nabble.com/problem...-maybe-boost-could-help-tf3959613.html#a11306879
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net