22 #ifndef MEDIASTATION_MEDIASCRIPT_OPERAND_H 23 #define MEDIASTATION_MEDIASCRIPT_OPERAND_H 25 #include "common/ptr.h" 26 #include "common/str.h" 28 #include "mediastation/mediascript/scriptconstants.h" 29 #include "mediastation/mediascript/variable.h" 37 Operand() : _type(kOperandTypeEmpty) {}
38 Operand(OperandType type) : _type(type) {}
40 OperandType getType()
const {
44 void putInteger(
int i);
47 void putDouble(
double d);
53 void putVariable(
Variable *variable);
56 void putFunctionId(uint functionId);
59 void putMethodId(BuiltInMethod methodId);
60 BuiltInMethod getMethodId();
62 void putAsset(uint32 assetId);
69 Operand getLiteralValue()
const;
71 bool operator==(
const Operand &other)
const;
72 bool operator<(
const Operand &other)
const;
73 bool operator>(
const Operand &other)
const;
75 bool operator||(
const Operand &other)
const;
76 bool operator!()
const;
77 bool operator&&(
const Operand &other)
const;
87 bool isInteger() {
return getType() == kOperandTypeLiteral1 || getType() == kOperandTypeLiteral2; };
88 bool isDouble() {
return getType() == kOperandTypeFloat1 || getType() == kOperandTypeFloat2; };
89 bool isNumber() {
return isInteger() || isDouble(); };
91 OperandType _type = kOperandTypeEmpty;
95 BuiltInMethod methodId;