node: make convenient input flag setter

This commit is contained in:
itsmattkc
2023-02-20 19:13:50 -08:00
parent 7348d28243
commit f9cd28a694
10 changed files with 63 additions and 38 deletions
+39 -13
View File
@@ -30,7 +30,7 @@ namespace olive {
class Node;
class NodeKeyframe;
enum InputFlag {
enum InputFlag : uint64_t {
/// By default, inputs are keyframable, connectable, and NOT arrays
kInputFlagNormal = 0x0,
kInputFlagArray = 0x1,
@@ -61,12 +61,6 @@ public:
return i;
}
InputFlags &operator|=(const InputFlags &f)
{
f_ |= f.f_;
return *this;
}
InputFlags operator|(const InputFlag &f) const
{
InputFlags i = *this;
@@ -74,12 +68,31 @@ public:
return i;
}
InputFlags operator|(const uint64_t &f) const
{
InputFlags i = *this;
i |= f;
return i;
}
InputFlags &operator|=(const InputFlags &f)
{
f_ |= f.f_;
return *this;
}
InputFlags &operator|=(const InputFlag &f)
{
f_ |= f;
return *this;
}
InputFlags &operator|=(const uint64_t &f)
{
f_ |= f;
return *this;
}
InputFlags operator&(const InputFlags &f) const
{
InputFlags i = *this;
@@ -87,12 +100,6 @@ public:
return i;
}
InputFlags &operator&=(const InputFlags &f)
{
f_ &= f.f_;
return *this;
}
InputFlags operator&(const InputFlag &f) const
{
InputFlags i = *this;
@@ -100,12 +107,31 @@ public:
return i;
}
InputFlags operator&(const uint64_t &f) const
{
InputFlags i = *this;
i &= f;
return i;
}
InputFlags &operator&=(const InputFlags &f)
{
f_ &= f.f_;
return *this;
}
InputFlags &operator&=(const InputFlag &f)
{
f_ &= f;
return *this;
}
InputFlags &operator&=(const uint64_t &f)
{
f_ &= f;
return *this;
}
InputFlags operator~() const
{
InputFlags i = *this;