still early version

This commit is contained in:
Marty Kraimer
2012-12-12 08:49:06 -05:00
parent 179d45e264
commit 7a0fda88ef
10 changed files with 1767 additions and 522 deletions

View File

@@ -32,13 +32,17 @@ using std::tr1::static_pointer_cast;
TestRecord::~TestRecord(){}
PVRecordPtr TestRecord::create(String const & recordName)
PVRecordPtr TestRecord::create(
String const & recordName)
{
String properties("alarm,timeStamp,display,control,valueAlarm");
PVStructurePtr pvStructure = getStandardPVField()->scalar(pvLong,properties);
PVLongPtr pvValue = pvStructure->getLongField("value");
PVRecordPtr pvRecord(new TestRecord(recordName,pvStructure,pvValue));
TestRecordPtr pvRecord(
new TestRecord(recordName,pvStructure,pvValue));
pvRecord->init();
PVFieldPtr pvField = pvStructure->getSubField("display.description");
pvRecord->immediatePutOK = pvField;
return pvRecord;
}
@@ -50,8 +54,6 @@ TestRecord::TestRecord(
pvValue(pvValue)
{}
bool TestRecord::isSynchronous() {return true;}
void TestRecord::process(
RecordProcessRequesterPtr const &processRequester,bool alreadyLocked)
{
@@ -63,6 +65,26 @@ void TestRecord::process(
dequeueProcessRequest(processRequester);
}
bool TestRecord::isSynchronous() {return true;}
void TestRecord::destroy()
{
PVRecord::destroy();
pvValue.reset();
immediatePutOK.reset();
}
bool TestRecord::requestImmediatePut(PVFieldPtr const &pvField)
{
if(pvField!=immediatePutOK) return false;
lock();
return true;
}
void TestRecord::immediatePutDone()
{
unlock();
}
}}