Skip to content

Commit 0cc59ce

Browse files
committed
Variable.h change
1 parent f8dea30 commit 0cc59ce

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Core/Algorithms/Base/AlgorithmBase.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ double AlgorithmParameter::toDouble() const
134134
return v ? *v : toInt();
135135
}
136136

137+
std::vector<double> AlgorithmParameter::toDoubleVector() const
138+
{
139+
const std::vector<double>* v = boost::get<std::vector<double>>(&value_);
140+
return v ? *v : std::vector<double>();
141+
}
142+
137143
std::string AlgorithmParameter::toString() const
138144
{
139145
const std::string* v = boost::get<std::string>(&value_);

src/Core/Algorithms/Base/Variable.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ namespace Algorithms {
5454
std::string,
5555
bool,
5656
AlgoOption,
57+
std::vector<double>,
5758
List
5859
> Value;
5960

6061
Variable() {}
6162
Variable(const Name& name, const Value& value);
62-
Variable(const Name& name, const Datatypes::DatatypeHandle& data) : name_(name), data_(data) {}
63+
enum DatatypeVariableDummyEnum { DATATYPE_VARIABLE };
64+
Variable(const Name& name, const Datatypes::DatatypeHandle& data, DatatypeVariableDummyEnum) : name_(name), data_(data) {}
6365
virtual ~Variable() {}
6466

6567
const Name& name() const { return name_; }
@@ -72,6 +74,7 @@ namespace Algorithms {
7274
std::string toString() const;
7375
boost::filesystem::path toFilename() const;
7476
bool toBool() const;
77+
std::vector<double> toDoubleVector() const;
7578
List toVector() const;
7679
AlgoOption toOption() const;
7780

0 commit comments

Comments
 (0)