/** * Copyright - See the COPYRIGHT that is included with this distribution. * pvAccessCPP is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ #include #include #include #include #if !defined(_WIN32) #include #define USE_SIGNAL #endif #include #include #include //! [Headers] #include #include #include #include //! [Headers] namespace pvd = epics::pvData; namespace pva = epics::pvAccess; namespace { epicsEvent done; #ifdef USE_SIGNAL void alldone(int num) { (void)num; done.signal(); } #endif struct Getter : public TestClientChannel::GetCallback, public TestClientChannel::ConnectCallback { POINTER_DEFINITIONS(Getter); const std::string name; TestClientChannel channel; TestOperation op; Getter(TestClientProvider& provider, const std::string& name) :name(name) ,channel(provider.connect(name)) { channel.addConnectListener(this); } virtual ~Getter() { channel.removeConnectListener(this); op.cancel(); } virtual void getDone(const TestGetEvent& event) { switch(event.event) { case TestGetEvent::Fail: std::cout<<"Error "<getSubField("value")); if(!valfld) valfld = event.value; std::cout< pvs_t; pvs_t pvs; for(int i=1; i(argv[++i]); } else { std::cerr << "--timeout requires value\n"; return 1; } } else { std::cerr<<"Unknown argument: "< gets_t; gets_t gets; for(pvs_t::const_iterator it=pvs.begin(); it!=pvs.end(); ++it) { const std::string& pv = *it; Getter::shared_pointer get(new Getter(provider, pv)); // addConnectListener() always invokes connectEvent() with current state gets.insert(get); } if(waitTime<0.0) done.wait(); else done.wait(waitTime); } catch(std::exception& e){ std::cerr<<"Error: "<