Line data Source code
1 :
2 : /* Copyright (c) 2011-2013, 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 "node.h"
19 :
20 : #include "application.h"
21 : #include "config.h"
22 :
23 : #include <seq/application.h>
24 : #include <seq/error.h>
25 :
26 : namespace seq
27 : {
28 : namespace detail
29 : {
30 :
31 1 : Node::Node( eq::Config* parent )
32 1 : : eq::Node( parent )
33 1 : {}
34 :
35 13 : Config* Node::getConfig()
36 : {
37 13 : return static_cast< Config* >( eq::Node::getConfig( ));
38 : }
39 :
40 2 : seq::Application* Node::getApplication()
41 : {
42 2 : return getConfig()->getApplication();
43 : }
44 :
45 1 : bool Node::configInit( const uint128_t& initID )
46 : {
47 1 : if( !eq::Node::configInit( initID ))
48 0 : return false;
49 :
50 1 : Config* config = getConfig();
51 1 : if( !config->mapData( initID ))
52 : {
53 0 : sendError( ERROR_SEQUEL_MAPOBJECT_FAILED );
54 0 : return false;
55 : }
56 :
57 1 : co::Object* initData = config->getInitData();
58 1 : getApplication()->clientInit( initData );
59 1 : return true;
60 : }
61 :
62 1 : bool Node::configExit()
63 : {
64 1 : getApplication()->clientExit();
65 1 : getConfig()->unmapData();
66 1 : return eq::Node::configExit();
67 : }
68 :
69 1 : void Node::frameStart( const uint128_t& frameID, const uint32_t frameNumber )
70 : {
71 1 : getConfig()->syncData( frameID );
72 1 : return eq::Node::frameStart( frameID, frameNumber );
73 : }
74 :
75 : }
76 3 : }
|