# # patch "netxx_pipe.cc" # from [c2ed9f8b68aa6b25f4c70140465b52d86ace4219] # to [0f6abc006ed294827179c933e8815ab888c3b1ca] # # patch "netxx_pipe.hh" # from [9cc46f74d0c72435c87e51793684c942d68c8c8a] # to [93ca99024df9aa17e98984e836da1cf8c30fab9d] # ======================================================================== --- netxx_pipe.cc c2ed9f8b68aa6b25f4c70140465b52d86ace4219 +++ netxx_pipe.cc 0f6abc006ed294827179c933e8815ab888c3b1ca @@ -233,6 +233,16 @@ is_pipe=true; pipe=&ps; } + +void Netxx::PipeCompatibleProbe::add(const StreamBase &sb, ready_type rt) +{ try + { add(const_cast(dynamic_cast(sb)),rt); + } + catch (...) + { assert(!is_pipe); + Probe::add(sb,rt); + } +} #endif #ifdef BUILD_UNIT_TESTS ======================================================================== --- netxx_pipe.hh 9cc46f74d0c72435c87e51793684c942d68c8c8a +++ netxx_pipe.hh 93ca99024df9aa17e98984e836da1cf8c30fab9d @@ -74,11 +74,14 @@ { if (is_pipe) { pipe=0; is_pipe=false; } else Probe::clear(); } result_type ready(const Timeout &timeout=Timeout(), ready_type rt=ready_none); void add(PipeStream &ps, ready_type rt=ready_none); + void add(const StreamBase &sb, ready_type rt=ready_none); void remove(const PipeStream &ps); +#if 0 // should be covered by StreamBase template void add (const T &t, ready_type rt=ready_none) { if (is_pipe) throw std::runtime_error("stream added to a pipe probe"); Probe::add(t,rt); } +#endif }; #else typedef Probe PipeCompatibleProbe;