1 #ifndef __JTOOLS__JROUTER__
2 #define __JTOOLS__JROUTER__
26 template<class JAddress_t, bool has_eq = JComparisonAvailable<JAddress_t>::has_eq>
33 template<
class JAddress_t>
45 std::vector<JAddress_t>(),
64 static JAddress_t address;
88 std::swap(this->first, router.first);
101 this->first = router.first;
103 if (router.size() > this->size()) {
104 this->resize(router.size());
119 this->push_back(address);
123 }
else if (id < this->first) {
125 this->insert(this->begin(), this->first -
id, getDefaultAddress());
129 (*this)[0] = address;
133 const size_t index = (size_t) (
id - this->first);
135 if (index >= this->size()) {
136 this->resize(index + 1, getDefaultAddress());
139 (*this)[index] = address;
152 return (
id >= this->first && id < this->first + (
int) this->size());
162 const JAddress_t&
get(
const int id)
const
164 return (*
this)[
id - this->first];
175 template<
class JAddress_t>
177 public JRouter<JAddress_t, false>
239 return __is_valid && address == __address;
266 defaultAddress(address)
277 return defaultAddress.is_valid();
288 return defaultAddress.getAddress();
299 defaultAddress = JAddress(address);
309 bool has(
const int id)
const
311 return (this->in_range(
id) && !this->defaultAddress.equals(this->get(
id)));
Template definition of test availability of comparison operators.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JArgument< T >::argument_type argument_type