Browse Source

BLOCKS API: Added some comparison operators to the Block class

tags/2021-05-28
jules 8 years ago
parent
commit
fd3b790087
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      modules/juce_blocks_basics/blocks/juce_Block.h

+ 7
- 3
modules/juce_blocks_basics/blocks/juce_Block.h View File

@@ -34,7 +34,6 @@ public:
virtual ~Block();
/** The different block types.
@see Block::getType()
*/
enum Type
@@ -70,14 +69,18 @@ public:
using UID = uint64;
/** This Block's UID.
This will be globally unique, and remains constant for a particular device.
*/
const UID uid;
//==============================================================================
/** Returns the type of this device.
/** Two blocks are considered equal if they have the same UID. */
bool operator== (const Block& other) const noexcept { return uid == other.uid; }
/** Two blocks are considered equal if they have the same UID. */
bool operator!= (const Block& other) const noexcept { return uid != other.uid; }
//==============================================================================
/** Returns the type of this device.
@see Block::Type
*/
virtual Type getType() const = 0;
@@ -314,6 +317,7 @@ public:
for (int i = 0; i < numOptionNames; ++i)
optionNames[i] = other.optionNames[i];
}
return *this;
}


Loading…
Cancel
Save