Equalizer  1.10.1
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
application.h
1 
2 /* Copyright (c) 2011-2015, Stefan Eilemann <eile@eyescale.ch>
3  * Petros Kataras <petroskataras@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQSEQUEL_APPLICATION_H
20 #define EQSEQUEL_APPLICATION_H
21 
22 #include <co/objectFactory.h> // interface
23 #include <seq/types.h>
24 #include <eq/client.h> // base class
25 
26 namespace seq
27 {
29 class Application : public eq::Client, public co::ObjectFactory
30 {
31 public:
33  SEQ_API Application();
34 
38  SEQ_API co::NodePtr getMasterNode();
40 
56  SEQ_API virtual bool init( const int argc, char** argv,
57  co::Object* initData );
58 
73  SEQ_API virtual bool run( co::Object* frameData );
74 
81  SEQ_API virtual bool exit();
82 
84  SEQ_API void stopRunning();
86 
99  virtual bool clientInit( co::Object* initData LB_UNUSED )
100  { return true; }
101 
103  virtual bool clientExit() { return true; }
104 
114  virtual Renderer* createRenderer() = 0;
115 
117  SEQ_API virtual void destroyRenderer( Renderer* renderer );
118 
128  SEQ_API virtual ViewData* createViewData();
129 
131  SEQ_API virtual void destroyViewData( ViewData* viewData );
133 
136  SEQ_API eq::Config* getConfig();
137  detail::Application* getImpl() { return _impl; }
138 
139 
151  SEQ_API bool registerObject( co::Object* object, const uint32_t type );
152 
161  SEQ_API bool deregister( co::Object* object );
163 
164 protected:
166  SEQ_API virtual ~Application();
167 
168 private:
169  detail::Application* _impl;
170 };
171 }
172 #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.
Definition: config.h:55
virtual bool clientInit(co::Object *initData)
Initialize a render client.
Definition: application.h:99
The main application object.
Definition: application.h:29
virtual SEQ_API ViewData * createViewData()
Create a new per-view data instance.
virtual Renderer * createRenderer()=0
Create a new renderer instance.
SEQ_API bool registerObject(co::Object *object, const uint32_t type)
Add and register a new object as master instance.
A renderer instance.
Definition: renderer.h:34
SEQ_API bool deregister(co::Object *object)
Remove and deregister an object.
Stores per-view data.
Definition: viewData.h:29
virtual bool clientExit()
Exit a render client.
Definition: application.h:103
SEQ_API Application()
Construct a new application instance.
virtual SEQ_API ~Application()
Destruct this application instance.
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.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.