pvAccessCPP  7.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
epics::pvAccess::MonitorElement::Ref Class Reference

A (single ownership) smart pointer to extract a MonitorElement from a Monitor queue. More...

#include <client/pv/monitor.h>

Public Member Functions

 Ref (Monitor &M)
 
 Ref (const Monitor::shared_pointer &M)
 
void swap (Ref &o)
 
MonitorElementPtr letGo ()
 analogous to auto_ptr<>::release() but given a different name to avoid being confused with Monitor::release()
 
void attach (Monitor &M)
 
void attach (const Monitor::shared_pointer &M)
 
bool next ()
 
void reset ()
 
Refoperator++ ()
 
 operator hidden_bool_type () const
 
MonitorElementoperator-> ()
 
MonitorElementoperator* ()
 
MonitorElementget ()
 
bool operator== (const Ref &o) const
 
bool operator!= (const Ref &o) const
 

Detailed Description

A (single ownership) smart pointer to extract a MonitorElement from a Monitor queue.

To fetch a single element

epics::pvAccess::Monitor::shared_pointer mon(....);
if(elem) {
// do something with element
assert(elem->pvStructurePtr->getSubField("foo"));
} else {
// queue was empty
}

To fetch all available elements (c++11)

epics::pvAccess::Monitor::shared_pointer mon(....);
for(auto& elem : *mon) {
assert(elem.pvStructurePtr->getSubField("foo"));
}

To fetch all available elements (c++98)

epics::pvAccess::Monitor::shared_pointer mon(....);
for(epics::pvAccess::MonitorElement::Ref it(mon); it; ++it) {
MonitorElement& elem(*it);
assert(elem.pvStructurePtr->getSubField("foo"));
}

Definition at line 146 of file monitor.h.


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