/* exampleRecord.cpp */ /** * Copyright - See the COPYRIGHT that is included with this distribution. * EPICS pvData is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ /** * @author mrk */ /* Marty Kraimer 2011.03 */ /* This connects to a V3 record and presents the data as a PVStructure * It provides access to value, alarm, display, and control. */ #include #include #include #include #include #include #include #include #include "exampleRecord.h" namespace epics { namespace pvDatabase { using namespace epics::pvData; using namespace epics::pvAccess; using std::tr1::static_pointer_cast; ExampleRecord::~ExampleRecord(){} PVRecordPtr ExampleRecord::create(String const & recordName) { String properties; PVStructurePtr pvStructure = getStandardPVField()->scalar(pvLong,properties); PVLongPtr pvValue = pvStructure->getLongField("value"); PVRecordPtr pvRecord(new ExampleRecord(recordName,pvStructure,pvValue)); return pvRecord; } ExampleRecord::ExampleRecord( String const & recordName, PVStructurePtr const & pvStructure, PVLongPtr const &pvValue) : PVRecord(recordName,pvStructure), pvValue(pvValue) {} bool ExampleRecord::isSynchronous() {return true;} void ExampleRecord::process( RecordProcessRequesterPtr const &processRequester) { pvValue->put(pvValue->get() + 1); processRequester->recordProcessResult(Status::Ok); processRequester->recordProcessComplete(); } }}