template<typename T>
static SGExpression<T>*
-SGReadIExpression(SGPropertyNode *inputRoot, const SGPropertyNode *expression);
+SGReadExpression(SGPropertyNode *inputRoot, const SGPropertyNode *expression);
template<typename T>
static bool
{
for (int i = 0; i < expression->nChildren(); ++i) {
SGExpression<T>* inputExpression;
- inputExpression = SGReadIExpression<T>(inputRoot, expression->getChild(i));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(i));
if (!inputExpression)
return false;
nary->addOperand(inputExpression);
template<typename T>
static SGExpression<T>*
-SGReadIExpression(SGPropertyNode *inputRoot, const SGPropertyNode *expression)
+SGReadExpression(SGPropertyNode *inputRoot, const SGPropertyNode *expression)
{
if (!expression)
return 0;
std::string name = expression->getName();
+
if (name == "value") {
T value;
if (!SGReadValueFromContent(expression, value)) {
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadIExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadIExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
SGSharedPtr<SGExpression<T> > inputExpression;
for (int i = 0; !inputExpression && i < expression->nChildren(); ++i)
- inputExpression = SGReadIExpression<T>(inputRoot, expression->getChild(i));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(i));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpressions[2] = {
- SGReadIExpression<T>(inputRoot, expression->getChild(0)),
- SGReadIExpression<T>(inputRoot, expression->getChild(1))
+ SGReadExpression<T>(inputRoot, expression->getChild(0)),
+ SGReadExpression<T>(inputRoot, expression->getChild(1))
};
if (!inputExpressions[0] || !inputExpressions[1]) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpressions[2] = {
- SGReadIExpression<T>(inputRoot, expression->getChild(0)),
- SGReadIExpression<T>(inputRoot, expression->getChild(1))
+ SGReadExpression<T>(inputRoot, expression->getChild(0)),
+ SGReadExpression<T>(inputRoot, expression->getChild(1))
};
if (!inputExpressions[0] || !inputExpressions[1]) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadIExpression<T>(inputRoot, inputNode);
+ inputExpression = SGReadExpression<T>(inputRoot, inputNode);
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return new SGInterpTableExpression<T>(inputExpression, tab);
}
- return 0;
-}
-
-
-template<typename T>
-static SGExpression<T>*
-SGReadFExpression(SGPropertyNode *inputRoot, const SGPropertyNode *expression)
-{
- SGExpression<T>* r = SGReadIExpression<T>(inputRoot, expression);
- if (r)
- return r;
-
- if (!expression)
- return 0;
-
- std::string name = expression->getName();
if (name == "acos") {
if (expression->nChildren() != 1) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpression;
- inputExpression = SGReadFExpression<T>(inputRoot, expression->getChild(0));
+ inputExpression = SGReadExpression<T>(inputRoot, expression->getChild(0));
if (!inputExpression) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpressions[2] = {
- SGReadFExpression<T>(inputRoot, expression->getChild(0)),
- SGReadFExpression<T>(inputRoot, expression->getChild(1))
+ SGReadExpression<T>(inputRoot, expression->getChild(0)),
+ SGReadExpression<T>(inputRoot, expression->getChild(1))
};
if (!inputExpressions[0] || !inputExpressions[1]) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpressions[2] = {
- SGReadFExpression<T>(inputRoot, expression->getChild(0)),
- SGReadFExpression<T>(inputRoot, expression->getChild(1))
+ SGReadExpression<T>(inputRoot, expression->getChild(0)),
+ SGReadExpression<T>(inputRoot, expression->getChild(1))
};
if (!inputExpressions[0] || !inputExpressions[1]) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpressions[2] = {
- SGReadFExpression<T>(inputRoot, expression->getChild(0)),
- SGReadFExpression<T>(inputRoot, expression->getChild(1))
+ SGReadExpression<T>(inputRoot, expression->getChild(0)),
+ SGReadExpression<T>(inputRoot, expression->getChild(1))
};
if (!inputExpressions[0] || !inputExpressions[1]) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
return 0;
}
SGSharedPtr<SGExpression<T> > inputExpressions[2] = {
- SGReadIExpression<T>(inputRoot, expression->getChild(0)),
- SGReadIExpression<T>(inputRoot, expression->getChild(1))
+ SGReadExpression<T>(inputRoot, expression->getChild(0)),
+ SGReadExpression<T>(inputRoot, expression->getChild(1))
};
if (!inputExpressions[0] || !inputExpressions[1]) {
SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
SGExpression<int>*
SGReadIntExpression(SGPropertyNode *inputRoot,
const SGPropertyNode *configNode)
-{ return SGReadIExpression<int>(inputRoot, configNode); }
+{ return SGReadExpression<int>(inputRoot, configNode); }
SGExpression<float>*
SGReadFloatExpression(SGPropertyNode *inputRoot,
const SGPropertyNode *configNode)
-{ return SGReadFExpression<float>(inputRoot, configNode); }
+{ return SGReadExpression<float>(inputRoot, configNode); }
SGExpression<double>*
SGReadDoubleExpression(SGPropertyNode *inputRoot,
const SGPropertyNode *configNode)
-{ return SGReadFExpression<double>(inputRoot, configNode); }
+{ return SGReadExpression<double>(inputRoot, configNode); }
// SGExpression<bool>*
// SGReadBoolExpression(SGPropertyNode *inputRoot,