15 #ifndef VISIONTRANSFER_PARAMETERVALUE_H
16 #define VISIONTRANSFER_PARAMETERVALUE_H
28 #include <visiontransfer/common.h>
30 namespace visiontransfer {
35 class ParameterValue {
54 VT_EXPORT ParameterValue();
55 VT_EXPORT ParameterValue(
const ParameterValue& other);
56 VT_EXPORT ~ParameterValue();
57 VT_EXPORT ParameterValue& operator= (
const ParameterValue& other);
58 VT_EXPORT ParameterValue& setType(ParameterType t);
59 VT_EXPORT
ParameterValue& setTensorShape(
const std::vector<unsigned int>& shape);
60 VT_EXPORT
bool isDefined()
const;
61 VT_EXPORT
bool isUndefined()
const;
62 VT_EXPORT
bool isTensor()
const;
63 VT_EXPORT
bool isScalar()
const;
64 VT_EXPORT
bool isCommand()
const;
65 VT_EXPORT
unsigned int getTensorDimension()
const;
66 VT_EXPORT std::vector<unsigned int> getTensorShape()
const;
71 VT_EXPORT
ParameterValue& setTensorData(
const std::vector<double>& data);
72 VT_EXPORT
unsigned int getTensorNumElements()
const;
73 VT_EXPORT
unsigned int getTensorCurrentDataSize()
const;
74 VT_EXPORT ParameterType getType()
const;
75 VT_EXPORT
double& tensorElementAt(
unsigned int x);
76 VT_EXPORT
double& tensorElementAt(
unsigned int y,
unsigned int x);
77 VT_EXPORT
double& tensorElementAt(
unsigned int z,
unsigned int y,
unsigned int x);
80 template<
typename T> VT_EXPORT T getValue()
const;
81 template<
typename T> VT_EXPORT T getWithDefault(
const T& deflt)
const;