node: make convenient input flag setter
This commit is contained in:
+39
-13
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user