interim commit

This commit is contained in:
Marty Kraimer
2013-04-12 15:17:21 -04:00
parent d67517b405
commit 124d28d33e
7 changed files with 223 additions and 11 deletions

View File

@@ -40,7 +40,7 @@ ExampleCounterPtr ExampleCounter::create(
epics::pvData::String const & recordName)
{
epics::pvData::PVStructurePtr pvStructure =
epics::pvData::getStandardPVField()->scalar(epics::pvData::pvDouble,"");
epics::pvData::getStandardPVField()->scalar(epics::pvData::pvLong,"timeStamp");
ExampleCounterPtr pvRecord(
new ExampleCounter(recordName,pvStructure));
if(!pvRecord->init()) pvRecord.reset();

View File

@@ -75,14 +75,6 @@ public:
static PVRecordPtr create(
epics::pvData::String const & recordName,
epics::pvData::PVStructurePtr const & pvStructure);
/**
* The constructor.
* @param recordName The name of the record, which is also the channelName.
* @param pvStructure The top level structure.
*/
PVRecord(
epics::pvData::String const & recordName,
epics::pvData::PVStructurePtr const & pvStructure);
/**
* The Destructor. Must be virtual.
*/
@@ -227,6 +219,14 @@ public:
*/
void toString(epics::pvData::StringBuilder buf,int indentLevel);
protected:
/**
* Constructor
* @param recordName The name of the record
* @param pvStructure The top level PVStructutre
*/
PVRecord(
epics::pvData::String const & recordName,
epics::pvData::PVStructurePtr const & pvStructure);
/**
* Initializes the base class. Must be called by derived classes.
*/
@@ -281,6 +281,10 @@ public:
* Destructor.
*/
virtual ~PVRecordField();
/**
* Release any resources used
*/
virtual void destroy();
/**
* Get the parent.
* @return The parent.
@@ -377,6 +381,10 @@ public:
* Destructor.
*/
virtual ~PVRecordStructure();
/**
* Release any resources used
*/
virtual void destroy();
/**
* Get the sub fields.
* @return the array of PVRecordFieldPtr.

View File

@@ -14,6 +14,7 @@
using std::tr1::static_pointer_cast;
using namespace epics::pvData;
using namespace epics::pvAccess;
using namespace std;
namespace epics { namespace pvDatabase {
@@ -85,6 +86,11 @@ void PVRecord::destroy()
pvRecordClientList.clear();
pvListenerList.clear();
pvRecordStructure->destroy();
pvRecordStructure.reset();
convert.reset();
pvStructure.reset();
unlock();
}
@@ -362,7 +368,17 @@ void PVRecordField::init()
pvField->setPostHandler(getPtrSelf());
}
PVRecordField::~PVRecordField() {}
PVRecordField::~PVRecordField()
{
}
void PVRecordField::destroy()
{
pvRecord.reset();
parent.reset();
pvField.reset();
pvListenerList.clear();
}
PVRecordStructurePtr PVRecordField::getParent() {return parent;}
@@ -435,7 +451,20 @@ PVRecordStructure::PVRecordStructure(
{
}
PVRecordStructure::~PVRecordStructure() {}
PVRecordStructure::~PVRecordStructure()
{
}
void PVRecordStructure::destroy()
{
PVRecordFieldPtrArray::iterator iter;
PVRecordField::destroy();
for(iter = pvRecordFields->begin() ; iter !=pvRecordFields->end(); iter++) {
(*iter)->destroy();
}
pvRecordFields.reset();
pvStructure.reset();
}
void PVRecordStructure::init()
{