pvAccessCPP  7.1.1
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
pvas::SharedPV Class Reference

A Shared State Process Variable (PV) More...

#include <server/pva/sharedstate.h>

Inheritance diagram for pvas::SharedPV:
Inheritance graph
[legend]
Collaboration diagram for pvas::SharedPV:
Collaboration graph
[legend]

Classes

struct  Handler
 Callbacks associated with a SharedPV. More...
 

Public Member Functions

 POINTER_DEFINITIONS (SharedPV)
 
void setHandler (const std::tr1::shared_ptr< Handler > &handler)
 Replace Handler given with ctor.
 
Handler::shared_pointer getHandler () const
 
bool isOpen () const
 test open-ness. cf. open() and close()
 
void open (const epics::pvData::PVStructure &value)
 Shorthand for. More...
 
void open (const epics::pvData::PVStructure &value, const epics::pvData::BitSet &valid)
 Begin allowing clients to connect. More...
 
void open (const epics::pvData::StructureConstPtr &type)
 Shorthand for. More...
 
void close (bool destroy=false)
 Force any clients to disconnect, and prevent re-connection. More...
 
std::tr1::shared_ptr< epics::pvData::PVStructurebuild ()
 Create a new container which may be used to prepare to call post(). More...
 
void post (const epics::pvData::PVStructure &value, const epics::pvData::BitSet &changed)
 Update the cached PVStructure in this SharedPV. More...
 
void fetch (epics::pvData::PVStructure &value, epics::pvData::BitSet &valid)
 Update arguments with current value, which is the initial value from open() with accumulated post() calls.
 
virtual std::tr1::shared_ptr< epics::pvAccess::Channelconnect (const std::tr1::shared_ptr< epics::pvAccess::ChannelProvider > &provider, const std::string &channelName, const std::tr1::shared_ptr< epics::pvAccess::ChannelRequester > &requester) OVERRIDE FINAL
 may call Handler::onFirstConnect() More...
 
virtual void disconnect (bool destroy, const epics::pvAccess::ChannelProvider *provider) OVERRIDE FINAL
 Disconnect all Channels created through the given ChannelProvider. More...
 
void setDebug (int lvl)
 
int isDebug () const
 
 POINTER_DEFINITIONS (ChannelBuilder)
 

Static Public Member Functions

static shared_pointer build (const std::tr1::shared_ptr< Handler > &handler, Config *conf=0)
 Allocate a new PV in the closed state. More...
 
static shared_pointer buildReadOnly (Config *conf=0)
 A SharedPV which fails all Put and RPC operations. In closed state.
 
static shared_pointer buildMailbox (Config *conf=0)
 A SharedPV which accepts all Put operations, and fails all RPC operations. In closed state.
 

Friends

struct detail::SharedChannel
 
struct detail::SharedMonitorFIFO
 
struct detail::SharedPut
 
struct detail::SharedRPC
 
void epics::pvAccess::providerRegInit (void *)
 

Detailed Description

A Shared State Process Variable (PV)

"Shared" in the sense that all clients/subscribers interact with the same PVStructure (excluding the RPC operation).

Warning
For the purposes of locking, this class is an Operation. eg. no locks may be held when calling post(), open(), close(), or connect(). provider_roles_requester_locking

This class contains a cached PVStructure, which is updated by post(), also a list of subscribing clients and in-progress network Operations.

On construction a SharedPV is in a "disconnected" state. It has no associated PVStructure (or Structure). No type. A type is associated via the open() method. After it has been open()'d. Calls to post() may be made. Calling close() will close all currently opened client channels.

Client channels, and operations on them, may be initiated at any time (via connect()). However, operations other than RPC will not proceed until open() is called.

Note
A SharedPV does not have a name. Name(s) are associated with a SharedPV By a Provider (StaticProvider, DynamicProvider, or any epics::pvAccess::ChannelProvider). These channel names may be seen via connect()
See also
Server API shared_ptr Ownership

Definition at line 76 of file sharedstate.h.


The documentation for this class was generated from the following file: