Thank you for your fast answer Johannes.
That's the thing that bothers me, why do you have 2 implementations for the same thing? Which one are you finally using?
About what you explain how bundle priority is working, I have figured it more or less reading the code, but it would be really helpful to now where specifically in the code is this ordered list defined, or where "storage sort all the bundles
according to the priority and iterate them in this order." is implemented in the code.
I found that this function has something to do about this, but I don't understand really well how it works:
ibrcommon::Mutex _bundleslock;
00112 std::set<dtn::data::Bundle> _bundles;
00113
00114 struct CMP_BUNDLE_PRIORITY
00115 {
00116 bool operator() (const dtn::data::MetaBundle& lhs, const dtn::data::MetaBundle& rhs) const
00117 {
00118 if (lhs.getPriority() == rhs.getPriority())
00119 return rhs > lhs;
00120
00121 return (lhs.getPriority() > rhs.getPriority());
00122 }
00123 };
00124
00125 std::set<dtn::data::MetaBundle, CMP_BUNDLE_PRIORITY> _priority_index;
00126 std::map<dtn::data::BundleID, ssize_t> _bundle_lengths;
00127
00128 size_t _maxsize;
00129 size_t _currentsize;
What's the meaning of rhs and lhs? It's maybe _priority_index the ordered list are you talking about? If it's so, where is the sorting process done? I think this function works to compare the priorities, but I can't find the function that pushes forward or pull back the files in the storage sorted list.
Alex López.