These are instances of shared pointer, specialized by different
interface-classes.
I needed to pass into methods
  void minute_calculator::add_listener(minute_message_receiver_ptr& mmr);

and 

 void multicast_communication::add_listener(market_message_receiver_ptr&
mmr);

 

shared pointer from the same object, which had to be upcasted to two
different bases.

 

I didn't find another way, might be I didn't find it persistently ((




 

  _____  

From: Ivan Sidarau [mailto:notifications@github.com] 
Sent: Monday, December 16, 2013 10:56 AM
To: sidorovis/cpp_craft_1013
Cc: PeterMoroz
Subject: Re: [cpp_craft_1013] please, merge my project into master branch
(#213)

 

In
solutions/peter_moroz/minute-market-data-project/sources/minute_market_data/
minute_market_data.cpp:

> +
> +bool multicast_communication::minute_market_data::start()
> +{
> +  quote_messages_processor_.reset(new quote_messages_processor());
> +  trade_messages_processor_.reset(new trade_messages_processor());
> +
> +  minute_calculator_.reset(new minute_calculator());
> +  multicast_communication_.reset(new multicast_communication());
> +
> +  if (!multicast_communication_->initialize())
> +  {
> +    std::cerr << "Can't initialize instance of
multicast_communication\n";
> +    return false;
> +  }
> +
> +  minute_message_receiver_ptr self_1 = shared_from_this();

do we really need here self_1 and self_2 ?

-
Reply to this email directly or view
<https://github.com/sidorovis/cpp_craft_1013/pull/213/files#r8361151>  it on
GitHub.
<https://github.com/notifications/beacon/5584499__eyJzY29wZSI6Ik5ld3NpZXM6Qm
VhY29uIiwiZXhwaXJlcyI6MTcwMjcxNjk4NywiZGF0YSI6eyJpZCI6MjE5NzMxNTl9fQ==--aef0
da37dbada35ab7b5acbda502bae699f93008.gif>