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

Public Member Functions

 POINTER_DEFINITIONS (ChannelPutGetLocal)
 
virtual ~ChannelPutGetLocal ()
 
virtual void destroy ()
 
virtual void putGet (PVStructurePtr const &pvPutStructure, BitSetPtr const &putBitSet)
 
virtual void getPut ()
 
virtual void getGet ()
 
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::ChannelPutGet
 POINTER_DEFINITIONS (ChannelPutGet)
 
virtual ~ChannelPutGet ()
 
virtual void putGet (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 ChannelPutGetLocalPtr create (ChannelLocalPtr const &channelLocal, ChannelPutGetRequester::shared_pointer const &channelPutGetRequester, PVStructurePtr const &pvRequest, PVRecordPtr const &pvRecord)
 

Additional Inherited Members

- Public Types inherited from epics::pvAccess::ChannelPutGet
typedef ChannelPutGetRequester 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 547 of file channelLocal.cpp.

Constructor & Destructor Documentation

epics::pvDatabase::ChannelPutGetLocal::~ChannelPutGetLocal ( )
virtual

Definition at line 654 of file channelLocal.cpp.

655 {
656 //cout << "~ChannelPutGetLocal()\n";
657 }

Member Function Documentation

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

566 {}
ChannelPutGetLocalPtr epics::pvDatabase::ChannelPutGetLocal::create ( ChannelLocalPtr const &  channelLocal,
ChannelPutGetRequester::shared_pointer const &  channelPutGetRequester,
PVStructurePtr const &  pvRequest,
PVRecordPtr const &  pvRecord 
)
static

Definition at line 606 of file channelLocal.cpp.

611 {
612  PVCopyPtr pvPutCopy = PVCopy::create(
613  pvRecord->getPVRecordStructure()->getPVStructure(),
614  pvRequest,
615  "putField");
616  PVCopyPtr pvGetCopy = PVCopy::create(
617  pvRecord->getPVRecordStructure()->getPVStructure(),
618  pvRequest,
619  "getField");
620  if(!pvPutCopy || !pvGetCopy) {
621  Status status(
622  Status::STATUSTYPE_ERROR,
623  "invalid pvRequest");
624  ChannelPutGet::shared_pointer channelPutGet;
625  channelPutGetRequester->channelPutGetConnect(
626  status,
627  channelPutGet,
628  nullStructure,
629  nullStructure);
630  ChannelPutGetLocalPtr localPutGet;
631  return localPutGet;
632  }
633  PVStructurePtr pvGetStructure = pvGetCopy->createPVStructure();
634  BitSetPtr getBitSet(new BitSet(pvGetStructure->getNumberFields()));
635  ChannelPutGetLocalPtr putGet(new ChannelPutGetLocal(
636  getProcess(pvRequest,true),
637  channelLocal,
638  channelPutGetRequester,
639  pvPutCopy,
640  pvGetCopy,
641  pvGetStructure,
642  getBitSet,
643  pvRecord));
644  if(pvRecord->getTraceLevel()>0)
645  {
646  cout << "ChannelPutGetLocal::create";
647  cout << " recordName " << pvRecord->getRecordName() << endl;
648  }
649  channelPutGetRequester->channelPutGetConnect(
650  Status::Ok, putGet, pvPutCopy->getStructure(),pvGetCopy->getStructure());
651  return putGet;
652 }
pvd::Status status
virtual void putGet(PVStructurePtr const &pvPutStructure, BitSetPtr const &putBitSet)
std::tr1::shared_ptr< PVCopy > PVCopyPtr
Definition: pvPlugin.h:25
A vector of bits.
Definition: bitSet.h:56
std::tr1::shared_ptr< ChannelPutGetLocal > ChannelPutGetLocalPtr
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< BitSet > BitSetPtr
Definition: bitSet.h:26
virtual void epics::pvDatabase::ChannelPutGetLocal::destroy ( )
inlinevirtual

Destroy this instance.

Implements epics::pvAccess::Destroyable.

Definition at line 554 of file channelLocal.cpp.

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

Get a channel instance this request belongs to.

Returns
the channel instance.

Implements epics::pvAccess::ChannelRequest.

Definition at line 659 of file channelLocal.cpp.

660 {
661  ChannelLocalPtr channel(channelLocal.lock());
662  return channel;
663 }
std::tr1::shared_ptr< ChannelLocal > ChannelLocalPtr
void epics::pvDatabase::ChannelPutGetLocal::getGet ( )
virtual

Get the get PVStructure. The record will not be processed. Completion status is reported by calling ChannelPutGetRequester.getGetDone() callback.

Implements epics::pvAccess::ChannelPutGet.

Definition at line 735 of file channelLocal.cpp.

736 {
737  ChannelPutGetRequester::shared_pointer requester = channelPutGetRequester.lock();
738  if(!requester) return;
739  PVRecordPtr pvr(pvRecord.lock());
740  if(!pvr) throw std::logic_error("pvRecord is deleted");
741  try {
742  getBitSet->clear();
743  {
744  epicsGuard <PVRecord> guard(*pvr);
745  pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet);
746  }
747  requester->getGetDone(
748  Status::Ok,getPtrSelf(),pvGetStructure,getBitSet);
749  if(pvr->getTraceLevel()>1)
750  {
751  cout << "ChannelPutGetLocal::getGet" << endl;
752  }
753  } catch(std::exception& ex) {
754  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
755  PVStructurePtr pvPutStructure;
756  BitSetPtr putBitSet;
757  requester->getGetDone(status,getPtrSelf(),pvGetStructure,getBitSet);
758  }
759 }
pvd::Status status
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
void epics::pvDatabase::ChannelPutGetLocal::getPut ( )
virtual

Get the put PVStructure. The record will not be processed. Completion status is reported by calling ChannelPutGetRequester.getPutDone() callback.

Implements epics::pvAccess::ChannelPutGet.

Definition at line 708 of file channelLocal.cpp.

709 {
710  ChannelPutGetRequester::shared_pointer requester = channelPutGetRequester.lock();
711  if(!requester) return;
712  PVRecordPtr pvr(pvRecord.lock());
713  if(!pvr) throw std::logic_error("pvRecord is deleted");
714  try {
715  PVStructurePtr pvPutStructure = pvPutCopy->createPVStructure();
716  BitSetPtr putBitSet(new BitSet(pvPutStructure->getNumberFields()));
717  {
718  epicsGuard <PVRecord> guard(*pvr);
719  pvPutCopy->initCopy(pvPutStructure, putBitSet);
720  }
721  requester->getPutDone(
722  Status::Ok,getPtrSelf(),pvPutStructure,putBitSet);
723  if(pvr->getTraceLevel()>1)
724  {
725  cout << "ChannelPutGetLocal::getPut" << endl;
726  }
727  } catch(std::exception& ex) {
728  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
729  PVStructurePtr pvPutStructure;
730  BitSetPtr putBitSet;
731  requester->getPutDone(status,getPtrSelf(),pvGetStructure,getBitSet);
732  }
733 }
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
virtual void epics::pvDatabase::ChannelPutGetLocal::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 569 of file channelLocal.cpp.

569 {}
void epics::pvDatabase::ChannelPutGetLocal::lock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 665 of file channelLocal.cpp.

666 {
667  PVRecordPtr pvr(pvRecord.lock());
668  if(!pvr) throw std::logic_error("pvRecord is deleted");
669  pvr->lock();
670 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21
epics::pvDatabase::ChannelPutGetLocal::POINTER_DEFINITIONS ( ChannelPutGetLocal  )
void epics::pvDatabase::ChannelPutGetLocal::putGet ( PVStructurePtr const &  pvPutStructure,
BitSetPtr const &  putBitSet 
)
virtual

Definition at line 679 of file channelLocal.cpp.

681 {
682  ChannelPutGetRequester::shared_pointer requester = channelPutGetRequester.lock();
683  if(!requester) return;
684  PVRecordPtr pvr(pvRecord.lock());
685  if(!pvr) throw std::logic_error("pvRecord is deleted");
686  try {
687  {
688  epicsGuard <PVRecord> guard(*pvr);
689  pvr->beginGroupPut();
690  pvPutCopy->updateMaster(pvPutStructure, putBitSet);
691  if(callProcess) pvr->process();
692  getBitSet->clear();
693  pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet);
694  pvr->endGroupPut();
695  }
696  requester->putGetDone(
697  Status::Ok,getPtrSelf(),pvGetStructure,getBitSet);
698  if(pvr->getTraceLevel()>1)
699  {
700  cout << "ChannelPutGetLocal::putGet" << endl;
701  }
702  } catch(std::exception& ex) {
703  Status status = Status(Status::STATUSTYPE_FATAL, ex.what());
704  requester->putGetDone(status,getPtrSelf(),pvGetStructure,getBitSet);
705  }
706 }
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::ChannelPutGetLocal::unlock ( )
virtual

Reimplemented from epics::pvAccess::Lockable.

Definition at line 671 of file channelLocal.cpp.

672 {
673  PVRecordPtr pvr(pvRecord.lock());
674  if(!pvr) throw std::logic_error("pvRecord is deleted");
675  pvr->unlock();
676 }
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21

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