This is Unofficial EPICS BASE Doxygen Site
epics::pvDatabase::ChannelProcessLocal Class Reference
+ Inheritance diagram for epics::pvDatabase::ChannelProcessLocal:
+ Collaboration diagram for epics::pvDatabase::ChannelProcessLocal:

Public Member Functions

 POINTER_DEFINITIONS (ChannelProcessLocal)
 
virtual ~ChannelProcessLocal ()
 
virtual void destroy ()
 
virtual void process ()
 
virtual std::tr1::shared_ptr< ChannelgetChannel ()
 
virtual void cancel ()
 
virtual void lock ()
 
virtual void unlock ()
 
virtual void lastRequest ()
 
- Public Member Functions inherited from epics::pvAccess::ChannelProcess
 POINTER_DEFINITIONS (ChannelProcess)
 
virtual ~ChannelProcess ()
 
- Public Member Functions inherited from epics::pvAccess::ChannelRequest
 POINTER_DEFINITIONS (ChannelRequest)
 
 ChannelRequest ()
 
virtual ~ChannelRequest ()
 
- Public Member Functions inherited from epics::pvAccess::Destroyable
 POINTER_DEFINITIONS (Destroyable)
 
- Public Member Functions inherited from epics::pvAccess::Lockable
 POINTER_DEFINITIONS (Lockable)
 
virtual ~Lockable ()
 

Static Public Member Functions

static ChannelProcessLocalPtr create (ChannelLocalPtr const &channelLocal, ChannelProcessRequester::shared_pointer const &channelProcessRequester, PVStructurePtr const &pvRequest, PVRecordPtr const &pvRecord)
 

Additional Inherited Members

- Public Types inherited from epics::pvAccess::ChannelProcess
typedef ChannelProcessRequester requester_type
 
- Static Public Attributes inherited from epics::pvAccess::ChannelRequest
static size_t num_instances
 
- Protected Member Functions inherited from epics::pvAccess::Destroyable
virtual ~Destroyable ()
 

Detailed Description

Definition at line 76 of file channelLocal.cpp.

Constructor & Destructor Documentation

epics::pvDatabase::ChannelProcessLocal::~ChannelProcessLocal ( )
virtual

Definition at line 157 of file channelLocal.cpp.

158 {
159 //cout << "~ChannelProcessLocal()\n";
160 }

Member Function Documentation

virtual void epics::pvDatabase::ChannelProcessLocal::cancel ( )
inlinevirtual

Cancel any pending request. Completion will be reported via request's response callback:

  • if cancel() request is issued after the request was already complete, request success/failure completion will be reported and cancel() request ignored.
  • if the request was actually canceled, cancellation completion is reported.

Implements epics::pvAccess::ChannelRequest.

Definition at line 91 of file channelLocal.cpp.

91 {}
ChannelProcessLocalPtr epics::pvDatabase::ChannelProcessLocal::create ( ChannelLocalPtr const &  channelLocal,
ChannelProcessRequester::shared_pointer const &  channelProcessRequester,
PVStructurePtr const &  pvRequest,
PVRecordPtr const &  pvRecord 
)
static

Definition at line 119 of file channelLocal.cpp.

124 {
125  PVFieldPtr pvField;
126  PVStructurePtr pvOptions;
127  int nProcess = 1;
128  if(pvRequest) pvField = pvRequest->getSubField("record._options");
129  if(pvField) {
130  pvOptions = static_pointer_cast<PVStructure>(pvField);
131  pvField = pvOptions->getSubField("nProcess");
132  if(pvField) {
133  PVStringPtr pvString = pvOptions->getSubField<PVString>("nProcess");
134  if(pvString) {
135  int size=0;
136  std::stringstream ss;
137  ss << pvString->get();
138  ss >> size;
139  nProcess = size;
140  }
141  }
142  }
143  ChannelProcessLocalPtr process(new ChannelProcessLocal(
144  channelLocal,
145  channelProcessRequester,
146  pvRecord,
147  nProcess));
148  if(pvRecord->getTraceLevel()>0)
149  {
150  cout << "ChannelProcessLocal::create";
151  cout << " recordName " << pvRecord->getRecordName() << endl;
152  }
153  channelProcessRequester->channelProcessConnect(Status::Ok, process);
154  return process;
155 }
FORCE_INLINE std::tr1::shared_ptr< PVField > getSubField(A a)
Definition: pvData.h:744
shared_ptr< T > static_pointer_cast(shared_ptr< U > const &r) BOOST_NOEXCEPT
Definition: shared_ptr.hpp:788
storage_t::arg_type get() const
Definition: pvData.h:396
PVString is special case, since it implements SerializableArray.
Definition: pvData.h:521
Data interface for a structure,.
Definition: pvData.h:712
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< PVString > PVStringPtr
Definition: pvData.h:540
std::tr1::shared_ptr< ChannelProcessLocal > ChannelProcessLocalPtr
std::tr1::shared_ptr< PVField > PVFieldPtr
Definition: pvData.h:66
virtual void epics::pvDatabase::ChannelProcessLocal::destroy ( )
inlinevirtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 83 of file channelLocal.cpp.

83 {} // DEPRECATED
std::tr1::shared_ptr< Channel > epics::pvDatabase::ChannelProcessLocal::getChannel ( )
virtual

Get a channel instance this request belongs to.

Returns
the channel instance.

Implements epics::pvAccess::ChannelRequest.

Definition at line 162 of file channelLocal.cpp.

163 {
164  ChannelLocalPtr channel(channelLocal.lock());
165  return channel;
166 }
std::tr1::shared_ptr< ChannelLocal > ChannelLocalPtr
virtual void epics::pvDatabase::ChannelProcessLocal::lastRequest ( )
inlinevirtual

Announce next request as last request. When last request will be completed (regardless of completion status) the remote and local instance will be destroyed.

Implements epics::pvAccess::ChannelRequest.

Definition at line 94 of file channelLocal.cpp.

94 {}
void epics::pvDatabase::ChannelProcessLocal::lock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 168 of file channelLocal.cpp.

169 {
170  PVRecordPtr pvr(pvRecord.lock());
171  if(!pvr) throw std::logic_error("pvRecord is deleted");
172  pvr->lock();
173 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
epics::pvDatabase::ChannelProcessLocal::POINTER_DEFINITIONS ( ChannelProcessLocal  )
void epics::pvDatabase::ChannelProcessLocal::process ( )
virtual

Issue a process request. Completion status is reported by calling ChannelProcessRequester.processDone() callback.

Implements epics::pvAccess::ChannelProcess.

Definition at line 181 of file channelLocal.cpp.

182 {
183  ChannelProcessRequester::shared_pointer requester = channelProcessRequester.lock();
184  if(!requester) return;
185  PVRecordPtr pvr(pvRecord.lock());
186  if(!pvr) throw std::logic_error("pvRecord is deleted");
187  if(pvr->getTraceLevel()>1)
188  {
189  cout << "ChannelProcessLocal::process";
190  cout << " nProcess " << nProcess << endl;
191  }
192  try {
193  for(int i=0; i< nProcess; i++) {
194  epicsGuard <PVRecord> guard(*pvr);
195  pvr->beginGroupPut();
196  pvr->process();
197  pvr->endGroupPut();
198  }
199  requester->processDone(Status::Ok,getPtrSelf());
200  } catch(std::exception& ex) {
201  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
202  requester->processDone(status,getPtrSelf());
203  }
204 }
pvd::Status status
int i
Definition: scan.c:967
const ChannelProcessRequester::weak_pointer requester
Definition: pvAccess.cpp:68
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
void epics::pvDatabase::ChannelProcessLocal::unlock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 174 of file channelLocal.cpp.

175 {
176  PVRecordPtr pvr(pvRecord.lock());
177  if(!pvr) throw std::logic_error("pvRecord is deleted");
178  pvr->unlock();
179 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21

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