Line data Source code
1 :
2 : /* Copyright (c) 2005-2011, Stefan Eilemann <eile@equalizergraphics.com>
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 EQ_NODEFACTORY_H
19 : #define EQ_NODEFACTORY_H
20 :
21 : #include <eq/client/types.h>
22 : #include <eq/client/api.h>
23 :
24 : namespace eq
25 : {
26 : /**
27 : * The node factory is a per-node singleton used to create and release
28 : * Equalizer resource instances.
29 : *
30 : * The instances have to be subclasses of the corresponding Equalizer
31 : * classes, and are used to selectively override task methods and store
32 : * additional, application-specific data.
33 : *
34 : * @sa eq::init()
35 : */
36 1 : class EQ_API NodeFactory
37 : {
38 : public:
39 : /**
40 : * Create a new config.
41 : *
42 : * @return the config.
43 : * @version 1.0
44 : */
45 : virtual Config* createConfig( ServerPtr parent );
46 :
47 : /** Release a config. @version 1.0 */
48 : virtual void releaseConfig( Config* config );
49 :
50 : /**
51 : * Create a new node.
52 : *
53 : * @return the node.
54 : * @version 1.0
55 : */
56 : virtual Node* createNode( Config* parent );
57 :
58 : /** Release a node. @version 1.0 */
59 : virtual void releaseNode( Node* node );
60 :
61 : /**
62 : * Create a new pipe.
63 : *
64 : * @return the pipe.
65 : * @version 1.0
66 : */
67 : virtual Pipe* createPipe( Node* parent );
68 :
69 : /** Release a pipe. @version 1.0 */
70 : virtual void releasePipe( Pipe* pipe );
71 :
72 : /**
73 : * Create a new window.
74 : *
75 : * @return the window.
76 : * @version 1.0
77 : */
78 : virtual Window* createWindow( Pipe* parent );
79 :
80 : /** Release a window. @version 1.0 */
81 : virtual void releaseWindow( Window* window );
82 :
83 : /**
84 : * Create a new channel.
85 : *
86 : * @return the channel.
87 : * @version 1.0
88 : */
89 : virtual Channel* createChannel( Window* parent );
90 :
91 : /** Release a channel. @version 1.0 */
92 : virtual void releaseChannel( Channel* channel );
93 :
94 : /**
95 : * Create a new observer.
96 : *
97 : * @return the observer.
98 : * @version 1.0
99 : */
100 : virtual Observer* createObserver( Config* parent );
101 :
102 : /** Release a observer. @version 1.0 */
103 : virtual void releaseObserver( Observer* observer );
104 :
105 : /**
106 : * Create a new layout.
107 : *
108 : * @return the layout.
109 : * @version 1.0
110 : */
111 : virtual Layout* createLayout( Config* parent );
112 :
113 : /** Release a layout. @version 1.0 */
114 : virtual void releaseLayout( Layout* layout );
115 :
116 : /**
117 : * Create a new view.
118 : *
119 : * @return the view.
120 : * @version 1.0
121 : */
122 : virtual View* createView( Layout* parent );
123 :
124 : /** Release a view. @version 1.0 */
125 : virtual void releaseView( View* view );
126 :
127 : /**
128 : * Create a new canvas.
129 : *
130 : * @return the canvas.
131 : * @version 1.0
132 : */
133 : virtual Canvas* createCanvas( Config* parent );
134 :
135 : /** Release a canvas. @version 1.0 */
136 : virtual void releaseCanvas( Canvas* canvas );
137 :
138 : /**
139 : * Create a new segment.
140 : *
141 : * @return the segment.
142 : * @version 1.0
143 : */
144 : virtual Segment* createSegment( Canvas* parent );
145 :
146 : /** Release a segment. @version 1.0 */
147 : virtual void releaseSegment( Segment* segment );
148 :
149 : /** Destruct this node factory. @version 1.0 */
150 9 : virtual ~NodeFactory(){}
151 : };
152 : }
153 :
154 : #endif // EQ_NODEFACTORY_H
155 :
|