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 version 2 as
7 # published by the Free Software Foundation;
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
23 class NS3DceHelper(object):
24 def __init__(self, simulation):
25 self.simulation = simulation
27 # Lock used to synchronize usage of DceManagerHelper
28 self._dce_manager_lock = threading.Lock()
29 # Lock used to synchronize usage of DceApplicationHelper
30 self._dce_application_lock = threading.Lock()
32 self._dce_manager_uuid = None
33 self._dce_application_uuid = None
36 def dce_manager_uuid(self):
37 if not self._dce_manager_uuid:
38 self._dce_manager_uuid = \
39 self.simulation.create("DceManagerHelper")
41 return self._dce_manager_uuid
44 def dce_application_uuid(self):
45 if not self._dce_application_uuid:
46 self._dce_application_uuid = \
47 self.simulation.create("DceApplicationHelper")
49 return self._dce_application_uuid
52 def dce_manager_lock(self):
53 return self._dce_manager_lock
56 def dce_application_lock(self):
57 return self._dce_application_lock