2 # NEPI, a framework to manage network experiments
3 # Copyright (C) 2014 INRIA
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
24 class NS3DceHelper(object):
25 def __init__(self, simulation):
26 self.simulation = simulation
28 # Lock used to synchronize usage of DceManagerHelper
29 self._dce_manager_lock = threading.Lock()
30 # Lock used to synchronize usage of DceApplicationHelper
31 self._dce_application_lock = threading.Lock()
33 self._dce_manager_uuid = None
34 self._dce_application_uuid = None
37 def dce_manager_uuid(self):
38 if not self._dce_manager_uuid:
39 self._dce_manager_uuid = \
40 self.simulation.create("DceManagerHelper")
42 return self._dce_manager_uuid
45 def dce_application_uuid(self):
46 if not self._dce_application_uuid:
47 self._dce_application_uuid = \
48 self.simulation.create("DceApplicationHelper")
50 return self._dce_application_uuid
53 def dce_manager_lock(self):
54 return self._dce_manager_lock
57 def dce_application_lock(self):
58 return self._dce_application_lock