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

Public Member Functions

 POINTER_DEFINITIONS (ChannelGetLocal)
 
virtual ~ChannelGetLocal ()
 
virtual void destroy ()
 
virtual void get ()
 
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::ChannelGet
 POINTER_DEFINITIONS (ChannelGet)
 
virtual ~ChannelGet ()
 
- 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 ChannelGetLocalPtr create (ChannelLocalPtr const &channelLocal, ChannelGetRequester::shared_pointer const &channelGetRequester, PVStructurePtr const &pvRequest, PVRecordPtr const &pvRecord)
 

Additional Inherited Members

- Public Types inherited from epics::pvAccess::ChannelGet
typedef ChannelGetRequester 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 206 of file channelLocal.cpp.

Constructor & Destructor Documentation

epics::pvDatabase::ChannelGetLocal::~ChannelGetLocal ( )
virtual

Definition at line 302 of file channelLocal.cpp.

303 {
304 //cout << "~ChannelGetLocal()\n";
305 }

Member Function Documentation

virtual void epics::pvDatabase::ChannelGetLocal::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 221 of file channelLocal.cpp.

221 {}
ChannelGetLocalPtr epics::pvDatabase::ChannelGetLocal::create ( ChannelLocalPtr const &  channelLocal,
ChannelGetRequester::shared_pointer const &  channelGetRequester,
PVStructurePtr const &  pvRequest,
PVRecordPtr const &  pvRecord 
)
static

Definition at line 260 of file channelLocal.cpp.

265 {
266  PVCopyPtr pvCopy = PVCopy::create(
267  pvRecord->getPVRecordStructure()->getPVStructure(),
268  pvRequest,
269  "");
270  if(!pvCopy) {
271  Status status(
272  Status::STATUSTYPE_ERROR,
273  "invalid pvRequest");
274  ChannelGet::shared_pointer channelGet;
275  channelGetRequester->channelGetConnect(
276  status,
277  channelGet,
278  nullStructure);
279  ChannelGetLocalPtr localGet;
280  return localGet;
281  }
282  PVStructurePtr pvStructure = pvCopy->createPVStructure();
283  BitSetPtr bitSet(new BitSet(pvStructure->getNumberFields()));
284  ChannelGetLocalPtr get(new ChannelGetLocal(
285  getProcess(pvRequest,false),
286  channelLocal,
287  channelGetRequester,
288  pvCopy,
289  pvStructure,
290  bitSet,
291  pvRecord));
292  if(pvRecord->getTraceLevel()>0)
293  {
294  cout << "ChannelGetLocal::create";
295  cout << " recordName " << pvRecord->getRecordName() << endl;
296  }
297  channelGetRequester->channelGetConnect(
298  Status::Ok,get,pvStructure->getStructure());
299  return get;
300 }
pvd::Status status
std::tr1::shared_ptr< PVCopy > PVCopyPtr
Definition: pvPlugin.h:25
A vector of bits.
Definition: bitSet.h:56
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< ChannelGetLocal > ChannelGetLocalPtr
std::tr1::shared_ptr< BitSet > BitSetPtr
Definition: bitSet.h:26
virtual void epics::pvDatabase::ChannelGetLocal::destroy ( )
inlinevirtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 213 of file channelLocal.cpp.

213 {} // DEPRECATED
void epics::pvDatabase::ChannelGetLocal::get ( )
virtual

Get data from the channel.

Ownership of the PVStructure passed to ChannelGetRequester::getDone() is returned to the ChannelGet.

Completion status is reported by calling ChannelGetRequester::getDone() callback.

Implements epics::pvAccess::ChannelGet.

Definition at line 327 of file channelLocal.cpp.

328 {
329  ChannelGetRequester::shared_pointer requester = channelGetRequester.lock();
330  if(!requester) return;
331  PVRecordPtr pvr(pvRecord.lock());
332  if(!pvr) throw std::logic_error("pvRecord is deleted");
333  try {
334  bool notifyClient = true;
335  bitSet->clear();
336  {
337  epicsGuard <PVRecord> guard(*pvr);
338  if(callProcess) {
339  pvr->beginGroupPut();
340  pvr->process();
341  pvr->endGroupPut();
342  }
343  notifyClient = pvCopy->updateCopySetBitSet(pvStructure, bitSet);
344  }
345  if(firstTime) {
346  bitSet->clear();
347  bitSet->set(0);
348  firstTime = false;
349  notifyClient = true;
350  }
351  if(notifyClient) {
352  requester->getDone(
353  Status::Ok,
354  getPtrSelf(),
355  pvStructure,
356  bitSet);
357  bitSet->clear();
358  } else {
359  BitSetPtr temp(new BitSet(bitSet->size()));
360  requester->getDone(
361  Status::Ok,
362  getPtrSelf(),
363  pvStructure,
364  temp);
365  }
366  if(pvr->getTraceLevel()>1)
367  {
368  cout << "ChannelGetLocal::get" << endl;
369  }
370  } catch(std::exception& ex) {
371  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
372  requester->getDone(status,getPtrSelf(),pvStructure,bitSet);
373  }
374 
375 }
pvd::Status status
A vector of bits.
Definition: bitSet.h:56
const ChannelProcessRequester::weak_pointer requester
Definition: pvAccess.cpp:68
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
std::tr1::shared_ptr< BitSet > BitSetPtr
Definition: bitSet.h:26
std::tr1::shared_ptr< Channel > epics::pvDatabase::ChannelGetLocal::getChannel ( )
virtual

Get a channel instance this request belongs to.

Returns
the channel instance.

Implements epics::pvAccess::ChannelRequest.

Definition at line 307 of file channelLocal.cpp.

308 {
309  ChannelLocalPtr channel(channelLocal.lock());
310  return channel;
311 }
std::tr1::shared_ptr< ChannelLocal > ChannelLocalPtr
virtual void epics::pvDatabase::ChannelGetLocal::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 224 of file channelLocal.cpp.

224 {}
void epics::pvDatabase::ChannelGetLocal::lock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 313 of file channelLocal.cpp.

314 {
315  PVRecordPtr pvr(pvRecord.lock());
316  if(!pvr) throw std::logic_error("pvRecord is deleted");
317  pvr->lock();
318 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
epics::pvDatabase::ChannelGetLocal::POINTER_DEFINITIONS ( ChannelGetLocal  )
void epics::pvDatabase::ChannelGetLocal::unlock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 319 of file channelLocal.cpp.

320 {
321  PVRecordPtr pvr(pvRecord.lock());
322  if(!pvr) throw std::logic_error("pvRecord is deleted");
323  pvr->unlock();
324 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21

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