Lumiera  0.pre.03
»edit your freedom«
buffhandle-attach.hpp File Reference

Go to the source code of this file.

Description

Extension to allow placing objects right into the buffers, taking ownership.

This extension is mostly helpful for writing unit-tests, and beyond that for the rather unusual case where we need to place an full-blown object into the buffer, instead of just plain data. A possible use case for this mechanism is to allow for state per calculation stream, feeding this local state to the individual render node embedded into a "state frame". Some effect processors indeed need to maintain state beyond the single frame (e.g. averaging, integrating, sound compression), which usually is handled by applying an "instance" of that processor to the frames to be calculated in a straight sequence.

BuffHandle and the underlying BufferProvider standard implementation support that case by attaching an object managing functor to the metadata. This way, the state can live directly embedded into the frame and still be accessed like an object. To keep the header and compilation footprint low, the implementation of the functions supporting this special case was split out of the basic buffhandle.hpp

See also
BuffHandle
BufferProviderProtocol_test usage demonstration

Definition in file buffhandle-attach.hpp.

Macros

#define _EXCEPTION_SAFE_INVOKE(_CTOR_)
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::engine
 Lumiera's render engine core and operational control.
 

Macro Definition Documentation

◆ _EXCEPTION_SAFE_INVOKE

#define _EXCEPTION_SAFE_INVOKE (   _CTOR_)
Value:
try \
{ \
return *new(pBuffer_) _CTOR_; \
} \
catch(...) \
{ \
emergencyCleanup(); /* EX_FREE */ \
pBuffer_ = 0; \
throw; \
}

Definition at line 62 of file buffhandle-attach.hpp.