20 #ifndef EQFABRIC_CONFIG_H 21 #define EQFABRIC_CONFIG_H 24 #include <eq/fabric/object.h> 25 #include <eq/fabric/types.h> 32 template <
class S,
class C,
class O,
class L,
class CV,
class N,
class V>
45 EQFABRIC_INL lunchbox::RefPtr<S>
getServer();
48 EQFABRIC_INL lunchbox::RefPtr<const S>
getServer()
const;
61 EQFABRIC_INL uint32_t getTimeout()
const;
67 const Nodes&
getNodes()
const {
return _nodes; }
68 EQFABRIC_INL N* findAppNode();
69 EQFABRIC_INL
const N* findAppNode()
const;
78 EQFABRIC_INL VisitorResult
accept(V& visitor);
81 EQFABRIC_INL VisitorResult
accept(V& visitor)
const;
85 EQFABRIC_INL T*
find(
const uint128_t&
id);
89 EQFABRIC_INL
const T*
find(
const uint128_t&
id)
const;
93 EQFABRIC_INL T*
find(
const std::string& name);
97 EQFABRIC_INL
const T*
find(
const std::string& name)
const;
100 O* getObserver(
const ObserverPath& path);
103 L* getLayout(
const LayoutPath& path);
106 CV* getCanvas(
const CanvasPath& path);
109 template <
typename T>
110 void find(
const uint128_t&
id, T** result);
113 template <
typename T>
114 void find(
const std::string& name,
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)
147 _fAttributes[attr] = value;
150 void setIAttribute(
const IAttribute attr,
const int32_t value)
152 _iAttributes[attr] = value;
158 return _fAttributes[attr];
164 return _iAttributes[attr];
168 static const std::string& getFAttributeString(
const FAttribute attr);
170 static const std::string& getIAttributeString(
const IAttribute attr);
186 virtual void setLatency(
const uint32_t latency);
191 EQFABRIC_INL
virtual void restore();
194 virtual void output(std::ostream&)
const {}
195 void create(O** observer);
196 void release(O* observer);
197 void create(L** layout);
198 void release(L* layout);
199 void create(CV** canvas);
200 void release(CV* canvas);
201 void create(N** node);
202 void release(N* node);
206 EQFABRIC_INL
explicit Config(lunchbox::RefPtr<S> parent);
209 EQFABRIC_INL
virtual ~Config();
212 EQFABRIC_INL
virtual void attach(
const uint128_t&
id,
213 const uint32_t instanceID);
216 EQFABRIC_INL
virtual void serialize(co::DataOStream& os,
217 const uint64_t dirtyBits);
218 EQFABRIC_INL
virtual void deserialize(co::DataIStream& is,
219 const uint64_t dirtyBits);
220 EQFABRIC_INL
virtual void notifyDetach();
223 virtual void _removeChild(
const uint128_t&) { LBUNIMPLEMENTED; }
224 template <
class,
class,
class,
class,
class,
class>
227 void setAppNodeID(
const co::NodeID& nodeID);
229 const co::NodeID& getAppNodeID()
const {
return _appNodeID; }
231 EQFABRIC_INL EventOCommand sendError(co::NodePtr node,
const uint32_t event,
234 virtual void changeLatency(
const uint32_t) { }
235 virtual bool mapViewObjects()
const {
return false; }
236 virtual bool mapNodeObjects()
const {
return false; }
238 virtual VisitorResult _acceptCompounds(V&) {
return TRAVERSE_CONTINUE; }
240 virtual VisitorResult _acceptCompounds(V&)
const 242 return TRAVERSE_CONTINUE;
244 template <
class C2,
class V2>
245 friend VisitorResult _acceptImpl(C2*, V2&);
247 N* _findNode(
const uint128_t&
id);
250 EQFABRIC_INL
virtual uint128_t commit(
251 const uint32_t incarnation = CO_COMMIT_NEXT);
256 lunchbox::RefPtr<S> _server;
259 float _fAttributes[FATTR_ALL];
262 int32_t _iAttributes[IATTR_ALL];
265 Observers _observers;
277 co::NodeID _appNodeID;
295 DIRTY_MEMBER = Object::DIRTY_CUSTOM << 0,
296 DIRTY_LATENCY = Object::DIRTY_CUSTOM << 1,
297 DIRTY_ATTRIBUTES = Object::DIRTY_CUSTOM << 2,
298 DIRTY_NODES = Object::DIRTY_CUSTOM << 3,
299 DIRTY_OBSERVERS = Object::DIRTY_CUSTOM << 4,
300 DIRTY_LAYOUTS = Object::DIRTY_CUSTOM << 5,
301 DIRTY_CANVASES = Object::DIRTY_CUSTOM << 6,
302 DIRTY_CONFIG_BITS = DIRTY_MEMBER | DIRTY_ATTRIBUTES | DIRTY_OBSERVERS |
303 DIRTY_LAYOUTS | DIRTY_CANVASES | DIRTY_NODES |
308 virtual uint64_t getRedistributableBits()
const 310 return DIRTY_CONFIG_BITS;
313 template <
class,
class>
315 void _addObserver(O* observer);
316 bool _removeObserver(O* observer);
318 template <
class,
class,
class>
320 void _addLayout(L* layout);
321 bool _removeLayout(L* layout);
323 template <
class,
class,
class,
class>
325 void _addCanvas(CV* canvas);
326 bool _removeCanvas(CV* canvas);
328 template <
class,
class,
class,
class>
330 void _addNode(N* node);
331 EQFABRIC_INL
bool _removeNode(N* node);
333 typedef co::CommandFunc<Config<S, C, O, L, CV, N, V>> CmdFunc;
334 bool _cmdNewLayout(co::ICommand& command);
335 bool _cmdNewCanvas(co::ICommand& command);
336 bool _cmdNewObserver(co::ICommand& command);
337 bool _cmdNewEntityReply(co::ICommand& command);
340 template <
class S,
class C,
class O,
class L,
class CV,
class N,
class V>
345 #endif // EQFABRIC_CONFIG_H const Observers & getObservers() const
EQFABRIC_INL VisitorResult accept(V &visitor)
Perform a depth-first traversal of this config.
EQFABRIC_INL lunchbox::RefPtr< S > getServer()
Defines export visibility macros for library EqualizerFabric.
Base data transport class for observers.
const Nodes & getNodes() const
DirtyBits
The changed parts of the object since the last pack().
EQFABRIC_INL T * find(const uint128_t &id)
std::vector< N * > Nodes
A vector of nodes.
Base co::Node class for a server.
float getFAttribute(const FAttribute attr) const
A wrapper for error codes to allow intuitive bool-like usage.
Base data transport class for nodes.
std::vector< L * > Layouts
A vector of layouts.
const Layouts & getLayouts() const
const Canvases & getCanvases() const
std::vector< O * > Observers
A vector of observers.
int32_t getIAttribute(const IAttribute attr) const
The Equalizer client library.
The default interocular distance in meters.
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
The version of the file loaded.
A canvas represents a logical 2D projection surface.
IAttribute
Integer attributes.
std::vector< CV * > Canvases
A vector of canvases.
Base data transport class for layouts.
Base data class for a configuration.
Internal base class for all distributed, inheritable Equalizer objects.
FAttribute
Floating-point attributes.
virtual void setLatency(const uint32_t latency)
Set the maximum accepted latency for this config.
uint32_t getLatency() const
Tolerate resource failures.