15 #ifndef VISIONTRANSFER_PARAMETERVALUE_H 16 #define VISIONTRANSFER_PARAMETERVALUE_H 28 #include <visiontransfer/common.h> 50 ParameterValue& setTensorShape(
const std::vector<unsigned int>& shape);
51 bool isDefined()
const;
52 bool isUndefined()
const;
53 bool isTensor()
const;
54 bool isScalar()
const;
55 bool isCommand()
const;
56 unsigned int getTensorDimension()
const;
57 std::vector<unsigned int> getTensorShape()
const;
59 std::vector<double> getTensorData()
const;
63 unsigned int getTensorNumElements()
const;
64 unsigned int getTensorCurrentDataSize()
const;
65 ParameterType getType()
const {
return type; }
66 double& tensorElementAt(
unsigned int x);
67 double& tensorElementAt(
unsigned int y,
unsigned int x);
68 double& tensorElementAt(
unsigned int z,
unsigned int y,
unsigned int x);
71 template<
typename T> T getValue()
const;
72 template<
typename T> T getWithDefault(
const T& deflt)
const {
return (type==TYPE_UNDEFINED) ? deflt : getValue<T>(); }
76 std::string stringVal;
77 unsigned int tensorNumElements;
78 std::vector<unsigned int> tensorShape;
79 std::vector<double> tensorData;
84 std::string sanitizeString(
const std::string& s,
unsigned int maxLength=4096);
std::vector< double > & getTensorDataReference()
Return a reference to the internal tensor data (caution)