SharedPV::Handler better defaults

This commit is contained in:
Michael Davidsaver
2018-10-18 17:47:32 -07:00
parent 0473797e6e
commit a486f3d4c7
2 changed files with 15 additions and 4 deletions

View File

@ -94,14 +94,14 @@ public:
*/
struct epicsShareClass Handler {
POINTER_DEFINITIONS(Handler);
virtual ~Handler() {}
virtual ~Handler();
virtual void onFirstConnect(const SharedPV::shared_pointer& pv) {}
//! Called when the last client disconnects. May close()
virtual void onLastDisconnect(const SharedPV::shared_pointer& pv) {}
//! Client requests Put
virtual void onPut(const SharedPV::shared_pointer& pv, Operation& op) {}
virtual void onPut(const SharedPV::shared_pointer& pv, Operation& op);
//! Client requests RPC
virtual void onRPC(const SharedPV::shared_pointer& pv, Operation& op) {}
virtual void onRPC(const SharedPV::shared_pointer& pv, Operation& op);
};
/** Allocate a new PV in the closed state.

View File

@ -29,7 +29,6 @@ struct MailboxHandler : public pvas::SharedPV::Handler {
virtual void onPut(const pvas::SharedPV::shared_pointer& self, pvas::Operation& op) OVERRIDE FINAL
{
self->post(op.value(), op.changed());
op.info("Set!");
op.complete();
}
static std::tr1::shared_ptr<pvas::SharedPV::Handler> build() {
@ -41,6 +40,18 @@ struct MailboxHandler : public pvas::SharedPV::Handler {
namespace pvas {
SharedPV::Handler::~Handler() {}
void SharedPV::Handler::onPut(const SharedPV::shared_pointer& pv, Operation& op)
{
op.complete(pvd::Status::error("Put not supported"));
}
void SharedPV::Handler::onRPC(const SharedPV::shared_pointer& pv, Operation& op)
{
op.complete(pvd::Status::error("RPC not supported"));
}
SharedPV::Config::Config()
:dropEmptyUpdates(true)
,mapperMode(pvd::PVRequestMapper::Mask)