author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Mon, 30 Jul 2007 19:11:21 +0100 | |
changeset 1735 | 9675c6b5452c |
parent 1734 | 64dcaf0b2bd3 |
child 1736 | b967654a135a |
permissions | -rw-r--r-- |
1733
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
2 |
/* |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INESC Porto |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
4 |
* All rights reserved. |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
5 |
* |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
6 |
* This program is free software; you can redistribute it and/or modify |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
7 |
* it under the terms of the GNU General Public License version 2 as |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation; |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
9 |
* |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
13 |
* GNU General Public License for more details. |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
14 |
* |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
16 |
* along with this program; if not, write to the Free Software |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
18 |
* |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
19 |
* Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
20 |
*/ |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
21 |
|
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
22 |
#ifndef OLSR_H |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
23 |
#define OLSR_H |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
24 |
|
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
25 |
#include "ns3/node-list.h" |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
26 |
|
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
27 |
namespace ns3 |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
28 |
{ |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
29 |
namespace olsr |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
30 |
{ |
1734
64dcaf0b2bd3
Add documentation for the (few) OLSR public APIs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1733
diff
changeset
|
31 |
// \brief Start the OLSR routing agent on all nodes |
1733
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
32 |
void EnableAllNodes (void); |
1734
64dcaf0b2bd3
Add documentation for the (few) OLSR public APIs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1733
diff
changeset
|
33 |
|
64dcaf0b2bd3
Add documentation for the (few) OLSR public APIs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1733
diff
changeset
|
34 |
// \brief Start the OLSR routing agent on a given list of nodes |
1735
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
35 |
template <typename InputIterator> |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
36 |
void EnableNodes (InputIterator begin, InputIterator end); |
1734
64dcaf0b2bd3
Add documentation for the (few) OLSR public APIs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1733
diff
changeset
|
37 |
|
64dcaf0b2bd3
Add documentation for the (few) OLSR public APIs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1733
diff
changeset
|
38 |
// \brief Start the OLSR routing agent on the given nodes |
1733
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
39 |
void EnableNode (Ptr<Node> node); |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
40 |
} |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
41 |
} |
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
42 |
|
1735
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
43 |
|
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
44 |
// implementation |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
45 |
namespace ns3 |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
46 |
{ |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
47 |
namespace olsr |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
48 |
{ |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
49 |
template <typename InputIterator> |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
50 |
void EnableNodes (InputIterator begin, InputIterator end) |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
51 |
{ |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
52 |
for (InputIterator i = begin; i != end; i++) |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
53 |
{ |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
54 |
EnableNode (*i); |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
55 |
} |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
56 |
} |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
57 |
} |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
58 |
} |
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
59 |
|
9675c6b5452c
Patch from Mathieu, makes EnableNodes templated
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1734
diff
changeset
|
60 |
|
1733
9552d9836732
Add a simpler olsr::EnableAllNodes API as suggested by Mathieu.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
61 |
#endif /* OLSR_H */ |