client: simplify monitor type handling
I think the original logic is correct, but I'm not sure. Cleverness to avoiding storing a Structure pointer is a premature optimization anyway.
This commit is contained in:
@@ -155,6 +155,7 @@ void MonitorFIFO::open(const pvd::StructureConstPtr& type)
|
||||
|
||||
opened = true;
|
||||
needConnected = true;
|
||||
this->type = type;
|
||||
|
||||
if(conf.ignoreRequestMask) {
|
||||
selectMask.clear();
|
||||
@@ -187,6 +188,7 @@ void MonitorFIFO::close()
|
||||
opened = false;
|
||||
needClosed = true;
|
||||
selectMask.clear();
|
||||
type.reset();
|
||||
}
|
||||
|
||||
void MonitorFIFO::finish()
|
||||
@@ -227,7 +229,7 @@ bool MonitorFIFO::tryPost(const pvData::PVStructure& value,
|
||||
empty.pop_front();
|
||||
} else if(force) {
|
||||
// allocate an extra element
|
||||
elem.reset(new MonitorElement(pvd::getPVDataCreate()->createPVStructure(inuse.back()->pvStructurePtr->getStructure())));
|
||||
elem.reset(new MonitorElement(pvd::getPVDataCreate()->createPVStructure(type)));
|
||||
}
|
||||
|
||||
if(elem) {
|
||||
|
||||
@@ -388,6 +388,8 @@ private:
|
||||
size_t freeHighLevel;
|
||||
epicsInt32 flowCount;
|
||||
|
||||
epics::pvData::StructureConstPtr type; // NULL if not opened
|
||||
|
||||
typedef std::list<MonitorElementPtr> buffer_t;
|
||||
// we allocate one extra buffer element to hold data when post()
|
||||
// while all elements poll()'d. So there will always be one
|
||||
|
||||
Reference in New Issue
Block a user