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

Public Member Functions

 POINTER_DEFINITIONS (ChannelPutLocal)
 
virtual ~ChannelPutLocal ()
 
virtual void destroy ()
 
virtual void put (PVStructurePtr const &pvStructure, BitSetPtr const &bitSet)
 
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::ChannelPut
 POINTER_DEFINITIONS (ChannelPut)
 
virtual ~ChannelPut ()
 
virtual void put (epics::pvData::PVStructure::shared_pointer const &pvPutStructure, epics::pvData::BitSet::shared_pointer const &putBitSet)=0
 
- 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 ChannelPutLocalPtr create (ChannelLocalPtr const &channelLocal, ChannelPutRequester::shared_pointer const &channelPutRequester, PVStructurePtr const &pvRequest, PVRecordPtr const &pvRecord)
 

Additional Inherited Members

- Public Types inherited from epics::pvAccess::ChannelPut
typedef ChannelPutRequester 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 377 of file channelLocal.cpp.

Constructor & Destructor Documentation

epics::pvDatabase::ChannelPutLocal::~ChannelPutLocal ( )
virtual

Definition at line 464 of file channelLocal.cpp.

465 {
466 //cout << "~ChannelPutLocal()\n";
467 }

Member Function Documentation

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

393 {}
ChannelPutLocalPtr epics::pvDatabase::ChannelPutLocal::create ( ChannelLocalPtr const &  channelLocal,
ChannelPutRequester::shared_pointer const &  channelPutRequester,
PVStructurePtr const &  pvRequest,
PVRecordPtr const &  pvRecord 
)
static

Definition at line 424 of file channelLocal.cpp.

429 {
430  PVCopyPtr pvCopy = PVCopy::create(
431  pvRecord->getPVRecordStructure()->getPVStructure(),
432  pvRequest,
433  "");
434  if(!pvCopy) {
435  Status status(
436  Status::STATUSTYPE_ERROR,
437  "invalid pvRequest");
438  ChannelPut::shared_pointer channelPut;
439  PVStructurePtr pvStructure;
440  BitSetPtr bitSet;
441  channelPutRequester->channelPutConnect(
442  status,
443  channelPut,
444  nullStructure);
445  ChannelPutLocalPtr localPut;
446  return localPut;
447  }
448  ChannelPutLocalPtr put(new ChannelPutLocal(
449  getProcess(pvRequest,true),
450  channelLocal,
451  channelPutRequester,
452  pvCopy,
453  pvRecord));
454  channelPutRequester->channelPutConnect(
455  Status::Ok, put, pvCopy->getStructure());
456  if(pvRecord->getTraceLevel()>0)
457  {
458  cout << "ChannelPutLocal::create";
459  cout << " recordName " << pvRecord->getRecordName() << endl;
460  }
461  return put;
462 }
pvd::Status status
std::tr1::shared_ptr< PVCopy > PVCopyPtr
Definition: pvPlugin.h:25
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
virtual void put(PVStructurePtr const &pvStructure, BitSetPtr const &bitSet)
std::tr1::shared_ptr< BitSet > BitSetPtr
Definition: bitSet.h:26
std::tr1::shared_ptr< ChannelPutLocal > ChannelPutLocalPtr
virtual void epics::pvDatabase::ChannelPutLocal::destroy ( )
inlinevirtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 384 of file channelLocal.cpp.

384 {} // DEPRECATED
void epics::pvDatabase::ChannelPutLocal::get ( )
virtual

Get the current data.

Ownership transfer as with ChannelGet::get()

Implements epics::pvAccess::ChannelPut.

Definition at line 489 of file channelLocal.cpp.

490 {
491  ChannelPutRequester::shared_pointer requester = channelPutRequester.lock();
492  if(!requester) return;
493  PVRecordPtr pvr(pvRecord.lock());
494  if(!pvr) throw std::logic_error("pvRecord is deleted");
495  try {
496  PVStructurePtr pvStructure = pvCopy->createPVStructure();
497  BitSetPtr bitSet(new BitSet(pvStructure->getNumberFields()));
498  bitSet->clear();
499  bitSet->set(0);
500  {
501  epicsGuard <PVRecord> guard(*pvr);
502  pvCopy->updateCopyFromBitSet(pvStructure, bitSet);
503  }
504  requester->getDone(
505  Status::Ok,getPtrSelf(),pvStructure,bitSet);
506  if(pvr->getTraceLevel()>1)
507  {
508  cout << "ChannelPutLocal::get" << endl;
509  }
510  } catch(std::exception& ex) {
511  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
512  PVStructurePtr pvStructure;
513  BitSetPtr bitSet;
514  requester->getDone(status,getPtrSelf(),pvStructure,bitSet);
515  }
516 }
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< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< BitSet > BitSetPtr
Definition: bitSet.h:26
std::tr1::shared_ptr< Channel > epics::pvDatabase::ChannelPutLocal::getChannel ( )
virtual

Get a channel instance this request belongs to.

Returns
the channel instance.

Implements epics::pvAccess::ChannelRequest.

Definition at line 469 of file channelLocal.cpp.

470 {
471  ChannelLocalPtr channel(channelLocal.lock());
472  return channel;
473 }
std::tr1::shared_ptr< ChannelLocal > ChannelLocalPtr
virtual void epics::pvDatabase::ChannelPutLocal::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 396 of file channelLocal.cpp.

396 {}
void epics::pvDatabase::ChannelPutLocal::lock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 475 of file channelLocal.cpp.

476 {
477  PVRecordPtr pvr(pvRecord.lock());
478  if(!pvr) throw std::logic_error("pvRecord is deleted");
479  pvr->lock();
480 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
epics::pvDatabase::ChannelPutLocal::POINTER_DEFINITIONS ( ChannelPutLocal  )
void epics::pvDatabase::ChannelPutLocal::put ( PVStructurePtr const &  pvStructure,
BitSetPtr const &  bitSet 
)
virtual

Definition at line 518 of file channelLocal.cpp.

520 {
521  ChannelPutRequester::shared_pointer requester = channelPutRequester.lock();
522  if(!requester) return;
523  PVRecordPtr pvr(pvRecord.lock());
524  if(!pvr) throw std::logic_error("pvRecord is deleted");
525  try {
526  {
527  epicsGuard <PVRecord> guard(*pvr);
528  pvr->beginGroupPut();
529  pvCopy->updateMaster(pvStructure, bitSet);
530  if(callProcess) {
531  pvr->process();
532  }
533  pvr->endGroupPut();
534  }
535  requester->putDone(Status::Ok,getPtrSelf());
536  if(pvr->getTraceLevel()>1)
537  {
538  cout << "ChannelPutLocal::put" << endl;
539  }
540  } catch(std::exception& ex) {
541  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
542  requester->putDone(status,getPtrSelf());
543  }
544 }
pvd::Status status
const ChannelProcessRequester::weak_pointer requester
Definition: pvAccess.cpp:68
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
void epics::pvDatabase::ChannelPutLocal::unlock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 481 of file channelLocal.cpp.

482 {
483  PVRecordPtr pvr(pvRecord.lock());
484  if(!pvr) throw std::logic_error("pvRecord is deleted");
485  pvr->unlock();
486 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21

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