Line data Source code
1 :
2 : /* Copyright (c) 2011-2012, Stefan Eilemann <eile@eyescale.ch>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #include "error.h"
19 :
20 : #include <eq/fabric/errorRegistry.h>
21 : #include <eq/fabric/global.h>
22 :
23 : namespace seq
24 : {
25 :
26 : namespace
27 : {
28 3 : struct ErrorData
29 : {
30 : const uint32_t code;
31 : const std::string text;
32 : };
33 :
34 2 : ErrorData _errors[] = {
35 : { ERROR_SEQUEL_MAPOBJECT_FAILED,
36 : "Mapping of data from application process failed" },
37 : { ERROR_SEQUEL_CREATERENDERER_FAILED,
38 : "Application::newRenderer returned 0" },
39 :
40 : { 0, "" } // last!
41 1 : };
42 : }
43 :
44 1 : void initErrors()
45 : {
46 1 : eq::fabric::ErrorRegistry& registry = eq::fabric::Global::getErrorRegistry();
47 :
48 3 : for( size_t i=0; _errors[i].code != 0; ++i )
49 2 : registry.setString( _errors[i].code, _errors[i].text );
50 1 : }
51 :
52 1 : void exitErrors()
53 : {
54 1 : eq::fabric::ErrorRegistry& registry = eq::fabric::Global::getErrorRegistry();
55 :
56 3 : for( size_t i=0; _errors[i].code != 0; ++i )
57 2 : registry.eraseString( _errors[i].code );
58 1 : }
59 :
60 3 : }
61 :
|