Equalizer  1.6.1
include/seq/application.h
1 
2 /* Copyright (c) 2011, 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 #ifndef EQSEQUEL_APPLICATION_H
19 #define EQSEQUEL_APPLICATION_H
20 
21 #include <co/objectFactory.h> // interface
22 #include <seq/types.h>
23 #include <eq/client/client.h> // base class
24 
25 namespace seq
26 {
28  class Application : public eq::Client, public co::ObjectFactory
29  {
30  public:
32  SEQ_API Application();
33 
35  SEQ_API virtual ~Application();
36 
40  SEQ_API co::NodePtr getMasterNode();
42 
58  SEQ_API virtual bool init( const int argc, char** argv,
59  co::Object* initData );
60 
75  SEQ_API virtual bool run( co::Object* frameData );
76 
83  SEQ_API virtual bool exit();
84 
86  SEQ_API void stopRunning();
88 
101  virtual bool clientInit( co::Object* initData ) { return true; }
102 
104  virtual bool clientExit() { return true; }
105 
114  virtual Renderer* createRenderer() = 0;
115 
117  SEQ_API virtual void destroyRenderer( Renderer* renderer );
118 
129  SEQ_API virtual ViewData* createViewData();
130 
132  SEQ_API virtual void destroyViewData( ViewData* viewData );
134 
137  SEQ_API eq::Config* getConfig();
138  detail::Application* getImpl() { return _impl; }
139 
140 
141  private:
142  detail::Application* _impl;
143  };
144 }
145 #endif // EQSEQUEL_APPLICATION_H
virtual void destroyRenderer(Renderer *renderer)
Delete the given renderer.
The main application object.
A configuration is a visualization session driven by an application.
void stopRunning()
Request that the application leaves its run loop.
virtual bool init(const int argc, char **argv, co::Object *initData)
Initialize the application instance.
co::NodePtr getMasterNode()
virtual bool exit()
Exit this application instance.
virtual ViewData * createViewData()
Create a new per-view data instance.
virtual bool clientExit()
Exit a render client.
Application()
Construct a new application instance.
virtual bool run(co::Object *frameData)
Run the application main loop.
The client represents a network node of the application in the cluster.
Definition: client/client.h:38
virtual void destroyViewData(ViewData *viewData)
Delete the given view data.
virtual Renderer * createRenderer()=0
Create a new renderer instance.
virtual ~Application()
Destruct this application instance.
Stores per-view data.
Definition: viewData.h:29
A renderer instance.
virtual bool clientInit(co::Object *initData)
Initialize a render client.