From 616e8946698770b61dbcd15cb5ace273466de23f Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Wed, 23 Mar 2016 22:15:32 +0100 Subject: [PATCH] c++11 compilation (take 2) references #28 --- pvtoolsSrc/eget.cpp | 40 ++++++++++++++++++++-------------------- pvtoolsSrc/pvget.cpp | 14 +++++++------- pvtoolsSrc/pvinfo.cpp | 4 ++-- pvtoolsSrc/pvput.cpp | 4 ++-- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/pvtoolsSrc/eget.cpp b/pvtoolsSrc/eget.cpp index d2b8842..b3a7881 100644 --- a/pvtoolsSrc/eget.cpp +++ b/pvtoolsSrc/eget.cpp @@ -68,7 +68,7 @@ void formatNTAny(std::ostream& o, PVStructurePtr const & pvStruct) void formatNTScalar(std::ostream& o, PVStructurePtr const & pvStruct) { - PVScalarPtr value = dynamic_pointer_cast(pvStruct->getSubField("value")); + PVScalarPtr value = TR1::dynamic_pointer_cast(pvStruct->getSubField("value")); if (value.get() == 0) { std::cerr << "no scalar_t 'value' field in NTScalar" << std::endl; @@ -135,7 +135,7 @@ std::ostream& formatScalarArray(std::ostream& o, PVScalarArrayPtr const & pvScal void formatNTScalarArray(std::ostream& o, PVStructurePtr const & pvStruct) { - PVScalarArrayPtr value = dynamic_pointer_cast(pvStruct->getSubField("value")); + PVScalarArrayPtr value = TR1::dynamic_pointer_cast(pvStruct->getSubField("value")); if (value.get() == 0) { std::cerr << "no scalar_t[] 'value' field in NTScalarArray" << std::endl; @@ -149,7 +149,7 @@ void formatNTScalarArray(std::ostream& o, PVStructurePtr const & pvStruct) void formatNTEnum(std::ostream& o, PVStructurePtr const & pvStruct) { - PVStructurePtr enumt = dynamic_pointer_cast(pvStruct->getSubField("value")); + PVStructurePtr enumt = TR1::dynamic_pointer_cast(pvStruct->getSubField("value")); if (enumt.get() == 0) { std::cerr << "no enum_t 'value' field in NTEnum" << std::endl; @@ -354,7 +354,7 @@ void formatNTTable(std::ostream& o, PVStructurePtr const & pvStruct) for (size_t i = 0; i < numColumns; i++) { - PVScalarArrayPtr array = dynamic_pointer_cast(fields[i]); + PVScalarArrayPtr array = TR1::dynamic_pointer_cast(fields[i]); if (array.get() == 0) { std::cerr << "malformed NTTable, " << (i+1) << ". field is not scalar_t[]" << std::endl; @@ -493,7 +493,7 @@ void formatNTNameValue(std::ostream& o, PVStructurePtr const & pvStruct) return; } - PVScalarArrayPtr array = dynamic_pointer_cast(value); + PVScalarArrayPtr array = TR1::dynamic_pointer_cast(value); if (array.get() == 0) { std::cerr << "malformed NTNameValue, 'value' field is not scalar_t[]" << std::endl; @@ -613,22 +613,22 @@ void formatNTNameValue(std::ostream& o, PVStructurePtr const & pvStruct) void formatNTURI(std::ostream& o, PVStructurePtr const & pvStruct) { - PVStringPtr scheme = dynamic_pointer_cast(pvStruct->getSubField("scheme")); + PVStringPtr scheme = TR1::dynamic_pointer_cast(pvStruct->getSubField("scheme")); if (scheme.get() == 0) { std::cerr << "no string 'scheme' field in NTURI" << std::endl; } - PVStringPtr authority = dynamic_pointer_cast(pvStruct->getSubField("authority")); + PVStringPtr authority = TR1::dynamic_pointer_cast(pvStruct->getSubField("authority")); - PVStringPtr path = dynamic_pointer_cast(pvStruct->getSubField("path")); + PVStringPtr path = TR1::dynamic_pointer_cast(pvStruct->getSubField("path")); if (path.get() == 0) { std::cerr << "no string 'path' field in NTURI" << std::endl; return; } - PVStructurePtr query = dynamic_pointer_cast(pvStruct->getSubField("query")); + PVStructurePtr query = TR1::dynamic_pointer_cast(pvStruct->getSubField("query")); o << scheme->get() << "://"; if (authority.get()) o << authority->get(); @@ -750,7 +750,7 @@ void formatNTNDArray(std::ostream& /*o*/, PVStructurePtr const & pvStruct) return; } - PVByteArrayPtr array = dynamic_pointer_cast(value); + PVByteArrayPtr array = TR1::dynamic_pointer_cast(value); if (array.get() == 0) { std::cerr << "currently only byte[] value is supported" << std::endl; @@ -851,7 +851,7 @@ void formatNT(std::ostream& o, PVFieldPtr const & pv) Type type = pv->getField()->getType(); if (type==structure) { - PVStructurePtr pvStruct = static_pointer_cast(pv); + PVStructurePtr pvStruct = TR1::static_pointer_cast(pv); { string id = pvStruct->getField()->getID(); @@ -918,15 +918,15 @@ void printValue(std::string const & channelName, PVStructure::shared_pointer con std::cout << *(value.get()) << std::endl; else if (valueType == scalarArray) { - //formatScalarArray(std::cout, dynamic_pointer_cast(value)); - formatVector(std::cout, "", dynamic_pointer_cast(value), false); + //formatScalarArray(std::cout, TR1::dynamic_pointer_cast(value)); + formatVector(std::cout, "", TR1::dynamic_pointer_cast(value), false); } else { // switch to structure mode, unless it's T-type if (valueType == structure && isTType(static_pointer_cast(value))) { - formatTType(std::cout, static_pointer_cast(value)); + formatTType(std::cout, TR1::static_pointer_cast(value)); std::cout << std::endl; } else @@ -961,12 +961,12 @@ void printValues(shared_vector const & names, vector(value)); else if (type == scalar) { - PVScalar::shared_pointer scalar = dynamic_pointer_cast(value); + PVScalar::shared_pointer scalar = TR1::dynamic_pointer_cast(value); scalars.push_back(scalar); // make an array, i.e. PVStringArray, out of a scalar (since scalar is an array w/ element count == 1) PVStringArray::shared_pointer StringArray = - dynamic_pointer_cast(getPVDataCreate()->createPVScalarArray(pvString)); + TR1::dynamic_pointer_cast(getPVDataCreate()->createPVScalarArray(pvString)); PVStringArray::svector values; values.push_back(scalar->getAs()); @@ -1383,7 +1383,7 @@ public: std::cout << m_channelName; std::cout << fieldSeparator; - formatTType(std::cout, static_pointer_cast(value)); + formatTType(std::cout, TR1::static_pointer_cast(value)); std::cout << std::endl; } else @@ -1857,7 +1857,7 @@ int main (int argc, char *argv[]) if (monitor) { - TR1::shared_ptr channelRequesterImpl = dynamic_pointer_cast(channel->getChannelRequester()); + TR1::shared_ptr channelRequesterImpl = TR1::dynamic_pointer_cast(channel->getChannelRequester()); channelRequesterImpl->showDisconnectMessage(); // TODO remove this line, when CA provider will allow creation of monitors @@ -1881,7 +1881,7 @@ int main (int argc, char *argv[]) Channel::shared_pointer channel = provider->createChannel(pvs[n], channelRequesterImpl); */ - TR1::shared_ptr channelRequesterImpl = dynamic_pointer_cast(channel->getChannelRequester()); + TR1::shared_ptr channelRequesterImpl = TR1::dynamic_pointer_cast(channel->getChannelRequester()); if (channelRequesterImpl->waitUntilConnected(timeOut)) { @@ -1903,7 +1903,7 @@ int main (int argc, char *argv[]) if (getFieldRequesterImpl.get()) { Structure::const_shared_pointer structure = - dynamic_pointer_cast(getFieldRequesterImpl->getField()); + TR1::dynamic_pointer_cast(getFieldRequesterImpl->getField()); if (structure.get() == 0 || structure->getField("value").get() == 0) { // fallback to structure diff --git a/pvtoolsSrc/pvget.cpp b/pvtoolsSrc/pvget.cpp index fbb2f46..38771c1 100644 --- a/pvtoolsSrc/pvget.cpp +++ b/pvtoolsSrc/pvget.cpp @@ -89,11 +89,11 @@ void printValue(std::string const & channelName, PVStructure::shared_pointer con if (valueType != scalar && valueType != scalarArray) { // switch to structure mode, unless it's T-type - if (valueType == structure && isTType(static_pointer_cast(value))) + if (valueType == structure && isTType(TR1::static_pointer_cast(value))) { std::cout << std::setw(30) << std::left << channelName; std::cout << fieldSeparator; - formatTType(std::cout, static_pointer_cast(value)); + formatTType(std::cout, TR1::static_pointer_cast(value)); std::cout << std::endl; } else @@ -293,11 +293,11 @@ public: if (valueType != scalar && valueType != scalarArray) { // switch to structure mode, unless it's T-type - if (valueType == structure && isTType(static_pointer_cast(value))) + if (valueType == structure && isTType(TR1::static_pointer_cast(value))) { std::cout << std::setw(30) << std::left << m_channelName; std::cout << fieldSeparator; - formatTType(std::cout, static_pointer_cast(value)); + formatTType(std::cout, TR1::static_pointer_cast(value)); std::cout << std::endl; } else @@ -591,7 +591,7 @@ int main (int argc, char *argv[]) for (int n = 0; n < nPvs; n++) { Channel::shared_pointer channel = channels[n]; - TR1::shared_ptr channelRequesterImpl = dynamic_pointer_cast(channel->getChannelRequester()); + TR1::shared_ptr channelRequesterImpl = TR1::dynamic_pointer_cast(channel->getChannelRequester()); if (channelRequesterImpl->waitUntilConnected(timeOut)) { @@ -612,7 +612,7 @@ int main (int argc, char *argv[]) if (getFieldRequesterImpl.get()) { Structure::const_shared_pointer structure = - dynamic_pointer_cast(getFieldRequesterImpl->getField()); + TR1::dynamic_pointer_cast(getFieldRequesterImpl->getField()); if (structure.get() == 0 || structure->getField("value").get() == 0) { // fallback to structure @@ -631,7 +631,7 @@ int main (int argc, char *argv[]) } else { - TR1::shared_ptr channelRequesterImpl = dynamic_pointer_cast(channel->getChannelRequester()); + TR1::shared_ptr channelRequesterImpl = TR1::dynamic_pointer_cast(channel->getChannelRequester()); channelRequesterImpl->showDisconnectMessage(); TR1::shared_ptr monitorRequesterImpl(new MonitorRequesterImpl(channel->getChannelName())); diff --git a/pvtoolsSrc/pvinfo.cpp b/pvtoolsSrc/pvinfo.cpp index d109498..2ba35cc 100644 --- a/pvtoolsSrc/pvinfo.cpp +++ b/pvtoolsSrc/pvinfo.cpp @@ -204,7 +204,7 @@ int main (int argc, char *argv[]) for (int n = 0; n < nPvs; n++) { Channel::shared_pointer channel = channels[n]; - TR1::shared_ptr channelRequesterImpl = dynamic_pointer_cast(channel->getChannelRequester()); + TR1::shared_ptr channelRequesterImpl = TR1::dynamic_pointer_cast(channel->getChannelRequester()); if (channelRequesterImpl->waitUntilConnected(timeOut)) { @@ -214,7 +214,7 @@ int main (int argc, char *argv[]) if (getFieldRequesterImpl->waitUntilFieldGet(timeOut)) { Structure::const_shared_pointer structure = - dynamic_pointer_cast(getFieldRequesterImpl->getField()); + TR1::dynamic_pointer_cast(getFieldRequesterImpl->getField()); channel->printInfo(); if (structure) diff --git a/pvtoolsSrc/pvput.cpp b/pvtoolsSrc/pvput.cpp index 35a783d..a6e0844 100644 --- a/pvtoolsSrc/pvput.cpp +++ b/pvtoolsSrc/pvput.cpp @@ -225,7 +225,7 @@ size_t fromString(PVFieldPtr const & fieldField, StringArray const & from, size_ if (fromStartIndex >= from.size()) throw std::runtime_error("not enough values"); - PVScalarPtr pv = static_pointer_cast(fieldField); + PVScalarPtr pv = TR1::static_pointer_cast(fieldField); getConvert()->fromString(pv, from[fromStartIndex]); return 1; } @@ -317,7 +317,7 @@ void printValue(std::string const & channelName, PVStructure::shared_pointer con // special case for enum if (valueType == structure) { - PVStructurePtr pvStructure = static_pointer_cast(value); + PVStructurePtr pvStructure = TR1::static_pointer_cast(value); if (pvStructure->getStructure()->getID() == "enum_t") { if (fieldSeparator == ' ')