Adding setup picture that matches the program code in terms of pins and sensor setup.
[iotcloud.git] / version2 / src / C / Slot.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 2233b0e..d708a79
@@ -12,7 +12,7 @@ Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_pre
        prevhmac(_prevhmac),
        hmac(_hmac),
        machineid(_machineid),
-       entries(new Vector<Entry *>()),
+       entries(new MyVector<Entry *>()),
        livecount(1),
        seqnumlive(true),
        freespace(SLOT_SIZE - getBaseSize()),
@@ -26,7 +26,7 @@ Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, Array<char> *_pre
        prevhmac(_prevhmac),
        hmac(NULL),
        machineid(_machineid),
-       entries(new Vector<Entry *>()),
+       entries(new MyVector<Entry *>()),
        livecount(1),
        seqnumlive(true),
        freespace(SLOT_SIZE - getBaseSize()),
@@ -40,7 +40,7 @@ Slot::Slot(Table *_table, int64_t _seqnum, int64_t _machineid, int64_t _localSeq
        prevhmac(new Array<char>(HMAC_SIZE)),
        hmac(NULL),
        machineid(_machineid),
-       entries(new Vector<Entry *>()),
+       entries(new MyVector<Entry *>()),
        livecount(1),
        seqnumlive(true),
        freespace(SLOT_SIZE - getBaseSize()),
@@ -83,7 +83,7 @@ bool Slot::hasSpace(Entry *e) {
        return newfreespace >= 0;
 }
 
-Vector<Entry *> *Slot::getEntries() {
+MyVector<Entry *> *Slot::getEntries() {
        return entries;
 }
 
@@ -98,7 +98,7 @@ Slot *Slot_decode(Table *table, Array<char> *array, Mac *mac) {
        bb->get(prevhmac);
        if (!realmac->equals(hmac))
                //throw new Error("Server Error: Invalid HMAC!  Potential Attack!");
-               error("Server Error: Invalid HMAC!  Potential Attack!\n");
+               myerror("Server Error: Invalid HMAC!  Potential Attack!\n");
        delete realmac;
        
        int64_t seqnum = bb->getLong();
@@ -149,8 +149,8 @@ Array<char> *Slot::encode(Mac *mac) {
  * itself.
  */
 
-Vector<Entry *> *Slot::getLiveEntries(bool resize) {
-       Vector<Entry *> *liveEntries = new Vector<Entry *>();
+MyVector<Entry *> *Slot::getLiveEntries(bool resize) {
+       MyVector<Entry *> *liveEntries = new MyVector<Entry *>();
        for (uint ei = 0; ei < entries->size(); ei++) {
                Entry *entry = entries->get(ei);
                if (entry->isLive()) {