servlib/bundling/BPQCache.h
changeset 64 1296a0283271
parent 56 76420d9f6e62
child 66 e1101c5d54a1
--- a/servlib/bundling/BPQCache.h	Tue Oct 18 11:52:07 2011 +0100
+++ b/servlib/bundling/BPQCache.h	Mon Oct 24 18:28:33 2011 +0100
@@ -1,5 +1,5 @@
 /*
- *    Copyright 2004-2006 Intel Corporation
+ *    Copyright 2010-2011 Trinity College Dublin
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -24,13 +24,16 @@
 #include "Bundle.h"
 #include <oasys/debug/Log.h>
 #include <oasys/util/StringUtils.h>
-
+#include "../reg/Registration.h"
+#include "../reg/RegistrationTable.h"
 namespace dtn {
 
 class BPQBlock;
 class BPQCacheEntry;
 class EndpointID;
 class BPQResponse;
+class RegistrationList;
+class RegistrationTable;
 
 class BPQCache : public oasys::Logger {
 public:
@@ -58,16 +61,20 @@
 
 protected:
 
-    void create_cache_entry(Bundle* bundle, std::string key);
-    void replace_cache_entry(Bundle* bundle, std::string key);
+    /**
+     * Build a new BPQCcacheEntry from this bundle.
+     * Copy the bundle into the fragment list
+     */
+    void create_cache_entry(Bundle* bundle, BPQBlock* block, std::string key);
+    void replace_cache_entry(Bundle* bundle, BPQBlock* block, std::string key);
     void append_cache_entry(Bundle* bundle, std::string key);
     int  update_bpq_block(Bundle* bundle, BPQBlock* block);
+    bool try_to_deliver(BPQCacheEntry* entry);
 
     /**
      * Calculate a hash table key from a bundle
-     * This is a concatenation of the Matching Rule and the Query
-     *
-     * If the query is too long, use a hash of the query
+     * This is a  SHA256 hash of the concatenation of:
+     * 		Matching Rule and Query Value
      */
     void get_hash_key(Bundle* bundle, std::string* key);
     void get_hash_key(BPQBlock* block, std::string* key);