Channel:push now returns an id value. Added Channel:hasRead(id), which returns true if the value that the id represents has already been popped, demanded, or cleared from the Channel. Resolves issue #1104.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-03-09 22:04:14 -04:00
parent e515cf076e
commit 140faf0cae
3 changed files with 29 additions and 35 deletions
+6 -4
View File
@@ -27,6 +27,7 @@
// LOVE
#include "common/Variant.h"
#include "common/int.h"
#include "threads.h"
namespace love
@@ -46,12 +47,13 @@ public:
static Channel *getChannel(const std::string &name);
unsigned long push(const Variant &var);
uint64 push(const Variant &var);
void supply(const Variant &var); // blocking push
bool pop(Variant *var);
void demand(Variant *var); // blocking pop
bool peek(Variant *var);
int getCount();
int getCount() const;
bool hasRead(uint64 id) const;
void clear();
private:
@@ -66,8 +68,8 @@ private:
bool named;
std::string name;
unsigned long sent;
unsigned long received;
uint64 sent;
uint64 received;
}; // Channel