Commits

Darrell Schiebel authored 9b33e62cef9
sync with CAS-14085 (and fix template bug) [CAS-14106]

src/code/display/Display/AttBufferTemplates.tcc

Modified
20 20 //# Internet email: aips2-request@nrao.edu.
21 21 //# Postal address: AIPS++ Project Office
22 22 //# National Radio Astronomy Observatory
23 23 //# 520 Edgemont Road
24 24 //# Charlottesville, VA 22903-2475 USA
25 25 //#
26 26 //# $Id$
27 27
28 28 #include <casa/Exceptions/Error.h>
29 29 #include <casa/Arrays/Vector.h>
30 -#include <casa/Utilities/DataType.h>
30 +
31 31 #include <display/Display/Attribute.h>
32 32 #include <display/Display/AttVal.h>
33 33 #include <display/Display/AttributeBuffer.h>
34 34
35 35 namespace casa { //# NAMESPACE CASA - BEGIN
36 36
37 37 template <class T>
38 38 casacore::Bool AttributeBuffer::getValue(const casacore::String &name, T &value) const {
39 39 casacore::Vector<T> tmp;
40 40 if (getValue(name, tmp)) {
41 41 value = tmp(0);
42 42 return true;
43 43 } else {
44 44 return false;
45 45 }
46 46 }
47 47
48 48 template <class T>
49 49 casacore::Bool AttributeBuffer::getValue(const casacore::String &name, casacore::Vector<T> &value) const {
50 - casacore::DataType dtype = casacore::whatType<casacore::Vector<T>>( );
50 + //casacore::Vector<T> tmp;
51 + casacore::DataType value_type = casacore::whatType<T>();
52 + casacore::DataType dtype = asArray(value_type);
51 53 /*AttValue::ValueType valType;
52 54 switch(dtype) {
53 55 case TpArrayUInt:
54 56 valType = AttValue::AtuInt;
55 57 break;
56 58 case TpArrayInt:
57 59 valType = AttValue::AtInt;
58 60 break;
59 61 case TpArrayBool:
60 62 valType = AttValue::AtBool;

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut