void TAO_Notify_Admin::save_persistent (TAO_Notify::Topology_Saver& saver) { bool changed = this->children_changed_; this->children_changed_ = false; this->self_changed_ = false; if (is_persistent ()) { TAO_Notify::NVPList attrs; this->save_attrs(attrs); const char* type = this->get_admin_type_name(); bool want_all_children = saver.begin_object(this->id(), type, attrs, changed); if (want_all_children || this->filter_admin_.is_changed ()) { this->filter_admin_.save_persistent(saver); } if (want_all_children || this->subscribed_types_.is_changed ()) { this->subscribed_types_.save_persistent(saver); } TAO_Notify::Save_Persist_Worker<TAO_Notify_Proxy> wrk(saver, want_all_children); this->proxy_container().collection()->for_each(&wrk); saver.end_object(this->id(), type); } }
void TAO_Notify_EventChannelFactory::save_persistent (TAO_Notify::Topology_Saver& saver) { bool changed = this->self_changed_; this->self_changed_ = false; this->children_changed_ = false; TAO_Notify::NVPList attrs; // ECF has no attributes bool want_all_children = saver.begin_object(0, "channel_factory", attrs, changed); // for each deleted child // delete_child // if the child has persistence. TAO_Notify::Save_Persist_Worker<TAO_Notify_EventChannel> wrk(saver, want_all_children); this->ec_container().collection()->for_each(&wrk); if (want_all_children || this->reconnect_registry_.is_changed ()) { this->reconnect_registry_.save_persistent(saver); } saver.end_object(0, "channel_factory"); }
int main( ) try { ba::io_service ios; ba::io_service::work wrk(ios); ba::ip::tcp::acceptor acceptor( ios, make_endpoint("0.0.0.0", 55555) ); start_accept( acceptor ); // boost::thread t1( run_ios, boost::ref( ios ) ); // boost::thread t2( run_ios, boost::ref( ios ) ); // boost::thread t3( run_ios, boost::ref( ios ) ); // boost::thread t4( run_ios, boost::ref( ios ) ); run_ios( ios ); return 0; } catch( const std::exception &ex ) { std::cout << "main error: " << ex.what( ) << "\n"; return 1; }
STDMETHODIMP CUUEngine::put_OutputPath(BSTR newVal) { MString wrk(newVal); ue.UUSetOption(UUOPT_SAVEPATH, 0, wrk.GetBuffer()); return S_OK; }
STDMETHODIMP CUUEngine::DLoad(BSTR toLoad, long *retVal) { ue.Invalidate(); NewStep(); // Let the owner know we're starting a new step MString wrk(toLoad); *retVal = ue.UULoadFile(wrk.GetBuffer(), wrk.GetBuffer(), 0); return S_OK; }
STDMETHODIMP CUUEngine::put_DFile(short row, BSTR newVal) { uulist *up = ue.GetUulp(row); if (up == NULL) return(CTL_E_INVALIDPROPERTYARRAYINDEX); MString wrk(newVal); ue.UURenameFile(up, wrk.GetBuffer()); return S_OK; }
//! Submit number of jobs and let the WorkThread to process them int main() { MyWork::getEventTable().addAllHandler(&handler); for (uint32_t i = 0; i < 5; ++i) { ThreadWorkPtr wrk(new MyWork(i)); logMsg(boost::format("Posting work %d") % i); WorkThread::instance().postWork(wrk); EventMain::instance().process(); } while (handled < 5) { EventMain::instance().process(); } logMsg("All jobs processed successfully."); }
void serial_port::threadfunc() { boost::asio::io_service::work wrk(io); io.run(); }