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 : namespace
26 : {
27 30 : struct ErrorData
28 : {
29 : const uint32_t code;
30 : const std::string text;
31 : };
32 :
33 20 : ErrorData _errors[] = {
34 : {ERROR_SEQUEL_MAPOBJECT_FAILED,
35 : "Mapping of data from application process failed"},
36 : {ERROR_SEQUEL_CREATERENDERER_FAILED, "Application::newRenderer returned 0"},
37 :
38 : {0, ""} // last!
39 10 : };
40 : }
41 :
42 1 : void initErrors()
43 : {
44 : eq::fabric::ErrorRegistry& registry =
45 1 : eq::fabric::Global::getErrorRegistry();
46 :
47 3 : for (size_t i = 0; _errors[i].code != 0; ++i)
48 2 : registry.setString(_errors[i].code, _errors[i].text);
49 1 : }
50 :
51 1 : void exitErrors()
52 : {
53 : eq::fabric::ErrorRegistry& registry =
54 1 : 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 30 : }
|