tempalte helpers; static initialization order

This commit is contained in:
Matej Sekoranja
2013-11-08 13:50:54 +01:00
parent 57b3e9a8b2
commit 1aff2ec112
8 changed files with 85 additions and 47 deletions

View File

@@ -398,22 +398,6 @@ void testStructure() {
serializationTest(pvStructure);
}
template<typename PVT>
std::tr1::shared_ptr<PVT> createPVScalar()
{
return std::tr1::static_pointer_cast<PVT>(
getPVDataCreate()->createPVScalar(PVT::typeCode)
);
}
template<typename PVAT>
std::tr1::shared_ptr<PVAT> createPVScalarArray()
{
return std::tr1::static_pointer_cast<PVAT>(
getPVDataCreate()->createPVScalarArray(PVAT::typeCode)
);
}
void testUnion() {
testDiag("Testing union...");
@@ -421,8 +405,8 @@ void testUnion() {
testOk1(factory.get()!=NULL);
PVDoublePtr doubleValue = createPVScalar<PVDouble>();
PVIntPtr intValue = createPVScalar<PVInt>();
PVDoublePtr doubleValue = factory->createPVScalar<PVDouble>();
PVIntPtr intValue = factory->createPVScalar<PVInt>();
testDiag("\tVariant union test");