projects
/
iot2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tested C++ RPS/RMI libraries for arbitrary objects and arbitrary remote calls
[iot2.git]
/
iotjava
/
iotrmi
/
C++
/
ConcurrentLinkedListQueue.hpp
diff --git
a/iotjava/iotrmi/C++/ConcurrentLinkedListQueue.hpp
b/iotjava/iotrmi/C++/ConcurrentLinkedListQueue.hpp
index e18e5e44f4991da763655a996dc2ae1b529438bf..20073236b629d05d70ed2b27a975d11a37f0b114 100644
(file)
--- a/
iotjava/iotrmi/C++/ConcurrentLinkedListQueue.hpp
+++ b/
iotjava/iotrmi/C++/ConcurrentLinkedListQueue.hpp
@@
-3,10
+3,12
@@
#include <iostream>
#include <mutex>
#include <iostream>
#include <mutex>
+#include "IoTRMIUtil.hpp"
+
/** Class ConcurrentLinkedListQueue is a queue that can handle
* concurrent requests and packets for IoT communication via socket.
* <p>
/** Class ConcurrentLinkedListQueue is a queue that can handle
* concurrent requests and packets for IoT communication via socket.
* <p>
- * It stores object through a
void
pointer.
+ * It stores object through a
char
pointer.
*
* @author Rahmadi Trimananda <rtrimana @ uci.edu>
* @version 1.0
*
* @author Rahmadi Trimananda <rtrimana @ uci.edu>
* @version 1.0
@@
-15,18
+17,20
@@
using namespace std;
using namespace std;
-mutex
mt
x;
+mutex
queueMute
x;
class Node {
private:
Node* next;
class Node {
private:
Node* next;
- void* value;
+ char* value;
+ int length;
public:
public:
- Node(
void* val
);
+ Node(
char* val, int len
);
~Node();
~Node();
- void* getValue();
+ char* getValue();
+ int getLength();
Node* getNext();
void setNext(Node* nxt);
Node* getNext();
void setNext(Node* nxt);
@@
-42,7
+46,8
@@
class ConcurrentLinkedListQueue {
public:
ConcurrentLinkedListQueue();
~ConcurrentLinkedListQueue();
public:
ConcurrentLinkedListQueue();
~ConcurrentLinkedListQueue();
- void enqueue(void* value); // Enqueue to tail
- void* dequeue(); // Dequeue from tail
+ void enqueue(char* value, int length); // Enqueue to tail
+ char* dequeue(); // Dequeue from tail
+ char* deQAndGetLength(int* length); // Dequeue from tail and return length
};
#endif
};
#endif