Bayonne 3 - API
 All Classes Namespaces Files Functions Variables Typedefs Macros
modules.cpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2011 David Sugar, Tycho Softworks.
2 //
3 // This file is part of GNU Bayonne.
4 //
5 // GNU Bayonne 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.
9 //
10 // GNU Bayonne 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.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with GNU Bayonne. If not, see <http://www.gnu.org/licenses/>.
17 
18 #include <config.h>
19 #include <ucommon/ucommon.h>
20 #include <ucommon/export.h>
21 #include <bayonne.h>
22 
23 using namespace BAYONNE_NAMESPACE;
24 using namespace UCOMMON_NAMESPACE;
25 
26 static LinkedObject *modules = NULL;
27 
28 Module::Module() :
29 LinkedObject(&modules)
30 {
31 }
32 
33 void Module::start(void)
34 {
35 }
36 
37 void Module::stop(void)
38 {
39 }
40 
41 void Module::startup(void)
42 {
43  linked_pointer<Module>mp = modules;
44 
45  while(is(mp)) {
46  mp->start();
47  mp.next();
48  }
49 }
50 
51 void Module::shutdown(void)
52 {
53  linked_pointer<Module>mp = modules;
54 
55  while(is(mp)) {
56  mp->stop();
57  mp.next();
58  }
59 }
60 
#define BAYONNE_NAMESPACE
Definition: bayonne.h:25
GNU Bayonne library namespace.