Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
include/seq/application.h
1 
2 /* Copyright (c) 2011-2014, 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 
37  SEQ_API co::NodePtr getMasterNode();
39 
55  SEQ_API virtual bool init( const int argc, char** argv,
56  co::Object* initData );
57 
72  SEQ_API virtual bool run( co::Object* frameData );
73 
80  SEQ_API virtual bool exit();
81 
83  SEQ_API void stopRunning();
85 
98  virtual bool clientInit( co::Object* initData LB_UNUSED )
99  { return true; }
100 
102  virtual bool clientExit() { return true; }
103 
113  virtual Renderer* createRenderer() = 0;
114 
116  SEQ_API virtual void destroyRenderer( Renderer* renderer );
117 
127  SEQ_API virtual ViewData* createViewData();
128 
130  SEQ_API virtual void destroyViewData( ViewData* viewData );
132 
135  SEQ_API eq::Config* getConfig();
136  detail::Application* getImpl() { return _impl; }
137 
138 
139 protected:
141  SEQ_API virtual ~Application();
142 
143 private:
144  detail::Application* _impl;
145 };
146 }
147 #endif // EQSEQUEL_APPLICATION_H
virtual SEQ_API bool exit()
Exit this application instance.
SEQ_API void stopRunning()
Request that the application leaves its run loop.
virtual SEQ_API bool run(co::Object *frameData)
Run the application main loop.
A configuration is a visualization session driven by an application.
The main application object.
virtual SEQ_API ViewData * createViewData()
Create a new per-view data instance.
virtual Renderer * createRenderer()=0
Create a new renderer instance.
A renderer instance.
Stores per-view data.
Definition: viewData.h:29
virtual bool clientExit()
Exit a render client.
SEQ_API Application()
Construct a new application instance.
virtual SEQ_API ~Application()
Destruct this application instance.
virtual bool clientInit(co::Object *initData 1)
Initialize a render client.
SEQ_API co::NodePtr getMasterNode()
virtual SEQ_API void destroyRenderer(Renderer *renderer)
Delete the given renderer.
The client represents a network node of the application in the cluster.
Definition: client/client.h:39
virtual SEQ_API bool init(const int argc, char **argv, co::Object *initData)
Initialize the application instance.
virtual SEQ_API void destroyViewData(ViewData *viewData)
Delete the given view data.