00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef QOLYESTER_DAEMON_SET_GATE_HXX
00020 # define QOLYESTER_DAEMON_SET_GATE_HXX 1
00021
00022 # include "gate.hh"
00023
00024 namespace olsr {
00025
00026 namespace set {
00027
00028 # ifdef QOLYESTER_ENABLE_NUMPREFIX
00029 GateEntry::GateEntry(const address_t& naddr, const unsigned prefix) :
00030 naddr_(naddr), prefix_(prefix) {}
00031 # else
00032 GateEntry::GateEntry(const address_t& naddr, const unsigned prefix) :
00033 naddr_(naddr), nmask_(address_t::netmask(prefix)), prefix_(prefix) {}
00034 # endif
00035
00036 GateSet::GateSet()
00037 : gset_(),
00038 hna_gset_(gset_)
00039 {}
00040
00041 std::pair<GateSet::iterator, bool>
00042 GateSet::insert(const gset_t::value_type& x) {
00043 std::pair<iterator, bool> p = gset_.insert(x);
00044 if (p.second)
00045 hna_gset_.insert(p.first);
00046 return p;
00047 }
00048
00049 void
00050 GateSet::erase(iterator pos) {
00051 hna_gset_.erase(pos);
00052 gset_.erase(pos);
00053 }
00054
00055 bool
00056 GateSet::empty() const {
00057 return gset_.empty();
00058 }
00059
00060 }
00061
00062 }
00063
00064 #endif // ! QOLYESTER_DAEMON_SET_GATE_HXX