14 #ifndef FFA_OP_UTILS_H
15 #define FFA_OP_UTILS_H
29 template <
class ToType,
class FromType>
31 const std::string& operationName,
const FromType&)
34 if (!fp)
return false;
47 template <
class RetType>
50 const std::string& operationName)
54 if (tryConverting(to,from,operationName,
double()))
return true;
55 if (tryConverting(to,from,operationName,
float()))
return true;
56 if (tryConverting(to,from,operationName,
int()))
return true;
57 if (tryConverting(to,from,operationName,
DoubleVec()))
return true;
58 if (tryConverting(to,from,operationName,
FaVec3()))
return true;
59 if (tryConverting(to,from,operationName,
FFaTensor3()))
return true;
60 if (tryConverting(to,from,operationName,
FFaTensor2()))
return true;
61 if (tryConverting(to,from,operationName,
FFaTensor1()))
return true;
62 if (tryConverting(to,from,operationName,
FaMat34()))
return true;
63 if (tryConverting(to,from,operationName,
FaMat33()))
return true;
66 std::cerr <<
" *** FFaOpUtils::getUnaryConvertOp: Invalid operation name \""
67 << operationName <<
"\""<< std::endl;
73 std::vector<std::string>
findOpers(
const std::string& varType,
74 bool silence =
false);
77 inline bool hasOpers(
const std::string& varType)
84 bool silence =
false);
Classes that make up the core of a operation/transformation system.
Base class for all operations.
Definition: FFaOperation.H:38
void unref()
Decrements the reference counter, and deletes *this if zero.
Definition: FFaOperation.H:49
The base class used as argument in other operations.
Definition: FFaOperation.H:76
Definition: FFaTensor1.H:24
Definition: FFaTensor2.H:27
Definition: FFaTensor3.H:27
A class for scalar operations.
Definition: FFaOperation.H:212
Definition: FFaMat33.H:15
Definition: FFaMat34.H:16
Class for point vectors in 3D space.
Definition: FFaVec3.H:40
Utilities for accessing unary operations.
Definition: FFaOpUtils.H:43
std::string getDefaultOper(const std::string &varType, bool silence=false)
Returns default operation name for a given variable type.
Definition: FFaOpUtils.C:52
std::vector< std::string > findOpers(const std::string &varType, bool silence=false)
Returns valid operation names for a given variable type.
Definition: FFaOpUtils.C:18
bool hasOpers(const std::string &varType)
Checks if given variable type has any operation defined.
Definition: FFaOpUtils.H:77
std::vector< double > DoubleVec
Convenience type definition.
Definition: FFaOpUtils.H:44
bool getUnaryConvertOp(FFaOperation< RetType > *&to, FFaOperationBase *from, const std::string &operationName)
Converts an operation based on name and return type.
Definition: FFaOpUtils.H:48