~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/services/EmberServices.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
Import upstream version 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2002  Hans H�ggstr�m
 
3
    Copyright (C) 2005  Erik Hjortsberg
 
4
 
 
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 2 of the License, or
 
8
    (at your option) any later version.
 
9
 
 
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.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with this program; if not, write to the Free Software
 
17
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
*/
 
19
 
 
20
#ifdef HAVE_CONFIG_H
 
21
#include "config.h"
 
22
#endif
 
23
 
 
24
#include "EmberServices.h"
 
25
 
 
26
//#include "test/TestService.h"
 
27
#include "logging/LoggingService.h"
 
28
#include "config/ConfigService.h"
 
29
#include "input/InputService.h"
 
30
//#include "gui/GuiService.h"
 
31
#include "sound/SoundService.h"
 
32
#include "metaserver/MetaserverService.h"
 
33
#include "server/ServerService.h"
 
34
#include "scripting/ScriptingService.h"
 
35
#include "wfut/WfutService.h"
 
36
#include "time/TimeService.h"
 
37
 
 
38
 
 
39
namespace Ember{
 
40
 
 
41
 
 
42
template<> Ember::EmberServices* Ember::Singleton<Ember::EmberServices>::ms_Singleton = 0;
 
43
 
 
44
 
 
45
        EmberServices::~EmberServices()
 
46
        {
 
47
        }
 
48
 
 
49
 
 
50
//   TestService* EmberServices::getTestService()
 
51
//   {
 
52
//     // TODO
 
53
//     return NULL;
 
54
//   }
 
55
 
 
56
        LoggingService* EmberServices::getLoggingService()
 
57
        {
 
58
                return mLoggingService->getService();
 
59
        }
 
60
 
 
61
        ConfigService* EmberServices::getConfigService()
 
62
        {
 
63
                return mConfigService->getService();
 
64
        }
 
65
 
 
66
        InputService* EmberServices::getInputService()
 
67
        {
 
68
                return mInputService->getService();
 
69
        }
 
70
 
 
71
 
 
72
/*
 
73
  GuiService* EmberServices::getGuiService()
 
74
  {
 
75
    if (myGuiService == NULL)
 
76
      myGuiService = new Ember::GuiService();
 
77
    
 
78
    return myGuiService;
 
79
  }
 
80
*/
 
81
        MetaserverService* EmberServices::getMetaserverService()
 
82
        {
 
83
                return mMetaserverService->getService();
 
84
        }
 
85
  
 
86
        ServerService* EmberServices::getServerService()
 
87
        {
 
88
                return mServerService->getService();
 
89
        }
 
90
 
 
91
        SoundService* EmberServices::getSoundService()
 
92
        {
 
93
                return mSoundService->getService();
 
94
        }
 
95
 
 
96
        ScriptingService* EmberServices::getScriptingService()
 
97
        {
 
98
                return mScriptingService->getService();
 
99
        }
 
100
  
 
101
        Ember::WfutService* EmberServices::getWfutService()
 
102
        {
 
103
                return mWfutService->getService();
 
104
        }
 
105
  
 
106
        Ember::Services::Time* EmberServices::getTimeService()
 
107
        {
 
108
                return mTimeService->getService();
 
109
        }
 
110
        
 
111
        EmberServices::EmberServices()
 
112
        : mScriptingService(std::auto_ptr<ServiceContainer<ScriptingService> >(new ServiceContainer<ScriptingService>()) )
 
113
        , mSoundService(std::auto_ptr<ServiceContainer<SoundService> >(new ServiceContainer<SoundService>()) )
 
114
        , mServerService(std::auto_ptr<ServiceContainer<ServerService> >(new ServiceContainer<ServerService>()) )
 
115
        , mMetaserverService(std::auto_ptr<ServiceContainer<MetaserverService> >(new ServiceContainer<MetaserverService>()) )
 
116
        , mInputService(std::auto_ptr<ServiceContainer<InputService> >(new ServiceContainer<InputService>()) )
 
117
        , mWfutService(std::auto_ptr<ServiceContainer<WfutService> >(new ServiceContainer<WfutService>()) )
 
118
        , mConfigService(std::auto_ptr<ServiceContainer<ConfigService> >(new ServiceContainer<ConfigService>()) )
 
119
        , mTimeService(std::auto_ptr<ServiceContainer<Services::Time> >(new ServiceContainer<Services::Time>()) )
 
120
        {
 
121
        }
 
122
 
 
123
}