root/trunk/freebob/src/cmhandler.cpp

Revision 14, 1.7 kB (checked in by wagi, 19 years ago)

Started new implementation according UML diagrams.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /* cmhandler.cpp
2  * Copyright (C) 2004 by Daniel Wagner
3  *
4  * This file is part of FreeBob.
5  *
6  * FreeBob is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * FreeBob 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 FreeBob; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA.
19  */
20
21 #include "cmhandler.h"
22 #include "ieee1394service.h"
23 #include "debugmodule.h"
24
25 CMHandler* CMHandler::m_pInstance = 0;
26
27 CMHandler::CMHandler()
28     : m_bInitialised( false )
29 {
30 }
31
32 CMHandler::~CMHandler()
33 {
34 }
35
36 FBReturnCodes
37 CMHandler::initialize()
38 {
39     if ( !m_bInitialised ) {
40         m_pIeee1394Service = Ieee1394Service::instance();
41
42         if ( !m_pIeee1394Service ) {
43             debugError( "Could not get an valid instance of 1394 service.\n" );
44             return eFBRC_InitializeCMHandlerFailed;
45         }
46         FBReturnCodes eStatus = m_pIeee1394Service->initialize();
47         if ( eStatus != eFBRC_Success ) {
48             debugError( "Initialising of 1394 service failed.\n" );
49             return eStatus;
50         }
51         m_bInitialised = true;
52     }
53     return eFBRC_Success;
54 }
55
56 CMHandler*
57 CMHandler::instance()
58 {
59     if ( !m_pInstance ) {
60         m_pInstance = new CMHandler;
61     }
62     return m_pInstance;
63 }
Note: See TracBrowser for help on using the browser.