20 #ifndef EQFABRIC_CONFIG_H
21 #define EQFABRIC_CONFIG_H
23 #include <eq/fabric/api.h>
24 #include <eq/fabric/types.h>
25 #include <eq/fabric/object.h>
32 template<
class S,
class C,
class O,
class L,
class CV,
class N,
class V >
39 typedef std::vector< N* >
Nodes;
44 EQFABRIC_INL lunchbox::RefPtr< S >
getServer();
47 EQFABRIC_INL lunchbox::RefPtr< const S >
getServer()
const;
62 EQFABRIC_INL uint32_t getTimeout()
const;
70 EQFABRIC_INL N* findAppNode();
71 EQFABRIC_INL
const N* findAppNode()
const;
80 EQFABRIC_INL VisitorResult
accept( V& visitor );
83 EQFABRIC_INL VisitorResult
accept( V& visitor )
const;
86 template<
typename T > EQFABRIC_INL T*
find(
const uint128_t&
id );
89 template<
typename T >
90 EQFABRIC_INL
const T*
find(
const uint128_t&
id )
const;
93 template<
typename T >
94 EQFABRIC_INL T*
find(
const std::string& name );
97 template<
typename T >
98 EQFABRIC_INL
const T*
find(
const std::string& name )
const;
101 O* getObserver(
const ObserverPath& path );
104 L* getLayout(
const LayoutPath& path );
107 CV* getCanvas(
const CanvasPath& path );
110 template<
typename T >
void find(
const uint128_t&
id, T** result );
113 template<
typename T >
void find(
const std::string& name,
114 const T** result )
const;
117 virtual void updateCanvas( CV* ) { }
120 virtual void exitCanvas( CV* ) { }
133 FATTR_ALL = FATTR_LAST + 5
141 IATTR_ALL = IATTR_LAST + 5
145 void setFAttribute(
const FAttribute attr,
const float value )
146 { _fAttributes[attr] = value; }
148 void setIAttribute(
const IAttribute attr,
const int32_t value )
149 { _iAttributes[attr] = value; }
153 {
return _fAttributes[attr]; }
157 {
return _iAttributes[attr]; }
160 static const std::string& getFAttributeString(
const FAttribute attr );
162 static const std::string& getIAttributeString(
const IAttribute attr );
179 virtual void setLatency(
const uint32_t latency );
185 EQFABRIC_INL
virtual void restore();
188 virtual void output( std::ostream& )
const {}
189 void create( O** observer );
190 void release( O* observer );
191 void create( L** layout );
192 void release( L* layout );
193 void create( CV** canvas );
194 void release( CV* canvas );
195 void create( N** node );
196 void release( N* node );
200 EQFABRIC_INL
Config( lunchbox::RefPtr< S > parent );
203 EQFABRIC_INL
virtual ~
Config();
206 EQFABRIC_INL
virtual void attach(
const UUID&
id,
207 const uint32_t instanceID );
210 EQFABRIC_INL
virtual void serialize( co::DataOStream& os,
211 const uint64_t dirtyBits );
212 EQFABRIC_INL
virtual void deserialize( co::DataIStream& is,
213 const uint64_t dirtyBits );
214 EQFABRIC_INL
virtual void notifyDetach();
217 virtual void _removeChild(
const UUID& )
220 template<
class,
class,
class,
class,
class,
class >
223 void setAppNodeID(
const co::NodeID& nodeID );
225 const co::NodeID& getAppNodeID()
const {
return _appNodeID; }
227 virtual void changeLatency(
const uint32_t ) { }
228 virtual bool mapViewObjects()
const {
return false; }
229 virtual bool mapNodeObjects()
const {
return false; }
232 virtual VisitorResult _acceptCompounds( V& )
233 {
return TRAVERSE_CONTINUE; }
235 virtual VisitorResult _acceptCompounds( V& )
const
236 {
return TRAVERSE_CONTINUE; }
237 template<
class C2,
class V2 >
238 friend VisitorResult _acceptImpl( C2*, V2& );
240 N* _findNode(
const uint128_t&
id );
243 EQFABRIC_INL
virtual uint128_t commit(
const uint32_t incarnation =
249 lunchbox::RefPtr< S > _server;
252 float _fAttributes[FATTR_ALL];
255 int32_t _iAttributes[IATTR_ALL];
270 co::NodeID _appNodeID;
274 BackupData() : latency( 1 ) {}
286 DIRTY_MEMBER = Object::DIRTY_CUSTOM << 0,
287 DIRTY_LATENCY = Object::DIRTY_CUSTOM << 1,
288 DIRTY_ATTRIBUTES = Object::DIRTY_CUSTOM << 2,
289 DIRTY_NODES = Object::DIRTY_CUSTOM << 3,
290 DIRTY_OBSERVERS = Object::DIRTY_CUSTOM << 4,
291 DIRTY_LAYOUTS = Object::DIRTY_CUSTOM << 5,
292 DIRTY_CANVASES = Object::DIRTY_CUSTOM << 6,
294 DIRTY_MEMBER | DIRTY_ATTRIBUTES | DIRTY_OBSERVERS |
295 DIRTY_LAYOUTS | DIRTY_CANVASES | DIRTY_NODES | DIRTY_LATENCY
299 virtual uint64_t getRedistributableBits()
const
300 {
return DIRTY_CONFIG_BITS; }
302 template<
class,
class >
friend class Observer;
303 void _addObserver( O* observer );
304 bool _removeObserver( O* observer );
306 template<
class,
class,
class >
friend class Layout;
307 void _addLayout( L* layout );
308 bool _removeLayout( L* layout );
310 template<
class,
class,
class,
class >
friend class Canvas;
311 void _addCanvas( CV* canvas );
312 bool _removeCanvas( CV* canvas );
314 template<
class,
class,
class,
class >
friend class Node;
315 void _addNode( N* node );
316 EQFABRIC_INL
bool _removeNode( N* node );
318 typedef co::CommandFunc< Config< S, C, O, L, CV, N, V > > CmdFunc;
319 bool _cmdNewLayout( co::ICommand& command );
320 bool _cmdNewCanvas( co::ICommand& command );
321 bool _cmdNewObserver( co::ICommand& command );
322 bool _cmdNewEntityReply( co::ICommand& command );
325 template<
class S,
class C,
class O,
class L,
class CV,
class N,
class V >
326 EQFABRIC_INL std::ostream& operator << ( std::ostream& os,
327 const Config< S, C, O, L, CV, N, V >& config );
330 #endif // EQFABRIC_CONFIG_H
Internal base class for all distributed, inheritable Equalizer objects.
float getFAttribute(const FAttribute attr) const
A configuration is a visualization session driven by an application.
virtual void setLatency(const uint32_t latency)
Set the maximum accepted latency for this config.
IAttribute
Possible values for integer attributes.
uint32_t getLatency() const
const Canvases & getCanvases() const
Tolerate resource failures.
int32_t getIAttribute(const IAttribute attr) const
const Observers & getObservers() const
const Layouts & getLayouts() const
std::vector< L * > Layouts
A vector of layouts.
std::vector< CV * > Canvases
A vector of canvases.
EQFABRIC_INL lunchbox::RefPtr< S > getServer()
FAttribute
Floating-point attributes.
const Nodes & getNodes() const
Base data class for a configuration.
std::vector< N * > Nodes
A vector of nodes.
EQFABRIC_INL T * find(const uint128_t &id)
The default interocular distance in meters.
EQFABRIC_INL VisitorResult accept(V &visitor)
Perform a depth-first traversal of this config.
The version of the file loaded.
std::vector< O * > Observers
A vector of observers.
IAttribute
Integer attributes.