From 84b22522cb087d0ea548f502e78e0d4da8ab8b09 Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Mon, 20 Dec 2010 19:48:06 +0100 Subject: [PATCH] Destruction. --- pvAccessApp/client/pvAccess.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pvAccessApp/client/pvAccess.h b/pvAccessApp/client/pvAccess.h index 2758c93..4c5b72c 100644 --- a/pvAccessApp/client/pvAccess.h +++ b/pvAccessApp/client/pvAccess.h @@ -32,6 +32,8 @@ namespace epics { namespace pvAccess { enum ConnectionState { NEVER_CONNECTED, CONNECTED, DISCONNECTED, DESTROYED }; + + const char* ConnectionStateNames[] = { "NEVER_CONNECTED", "CONNECTED", "DISCONNECTED", "DESTROYED" }; class Channel; @@ -118,7 +120,7 @@ namespace epics { namespace pvAccess { * @author mrk * */ - class ChannelFind { + class ChannelFind : public epics::pvData::Destroyable, private epics::pvData::NoDefaultMethods { public: virtual ChannelProvider* getChannelProvider() = 0; virtual void cancelChannelFind() = 0; @@ -592,6 +594,7 @@ namespace epics { namespace pvAccess { */ class ChannelAccess : private epics::pvData::NoDefaultMethods { public: + virtual ~ChannelAccess() {}; /** * Get the provider with the specified name. @@ -617,7 +620,7 @@ namespace epics { namespace pvAccess { * @author mrk * */ - class ChannelProvider : private epics::pvData::NoDefaultMethods { + class ChannelProvider : public epics::pvData::Destroyable, private epics::pvData::NoDefaultMethods { public: /** Minimal priority. */ @@ -633,11 +636,6 @@ namespace epics { namespace pvAccess { /** OPI priority. */ static const short PRIORITY_OPI = PRIORITY_MIN; - /** - * Terminate. - */ - virtual void destroy() = 0; - /** * Get the provider name. * @return The name. @@ -659,7 +657,7 @@ namespace epics { namespace pvAccess { * @param priority channel priority, must be PRIORITY_MIN <= priority <= PRIORITY_MAX. * @return Channel instance. If channel does not exist null is returned and channelRequester notified. */ - virtual Channel* createChannel(epics::pvData::String channelName,ChannelRequester *channelRequester,short priority) = 0; + virtual Channel* createChannel(epics::pvData::String channelName,ChannelRequester *channelRequester,short priority = PRIORITY_DEFAULT) = 0; /** * Create a channel. @@ -684,7 +682,7 @@ namespace epics { namespace pvAccess { * Get context implementation version. * @return version of the context implementation. */ - virtual const Version* getVersion() = 0; + virtual Version* getVersion() = 0; /** * Initialize client context. This method is called immediately after instance construction (call of constructor). @@ -695,7 +693,7 @@ namespace epics { namespace pvAccess { * Get channel provider implementation. * @return the channel provider. */ - virtual const ChannelProvider* getProvider() = 0; + virtual ChannelProvider* getProvider() = 0; /** * Prints detailed information about the context to the standard output stream.