ImFusion SDK 4.3
ImageStreamCache Class Reference

#include <ImFusion/Stream/ImageStreamCache.h>

A singleton class for caching the output of an ImageStream in a SharedImageSet. More...

+ Inheritance diagram for ImageStreamCache:

Detailed Description

A singleton class for caching the output of an ImageStream in a SharedImageSet.

The ImageStreamCache class provides a convenient way to access the image data of a ImageStream from different locations. When a new image for a ImageStream is requested, the ImageStreamCache attaches itself to the stream and stores the image data in the MemImage of a SharedImageSet. Once the last user of the requested image is deleted, the ImageStreamCache is detaching itself from the stream again. To track the lifetime of the requested image, the SharedImageSet is not returned directly but wrapped in a StreamSharedImageSet that behaves like a scoped pointer.

Note
Synchronization to protect against concurrent access is only provided for the Stream thread and the main GUI thread. Therefore, you must use the provided StreamSharedImageSet only from the main thread.

Classes

struct  StreamCacheElement
 

Signals

void updateRequested ()
 Emitted after a StreamSharedImageSet has been updated to signal redrawing of the DisplayWidget.
 
void imageReceived (ImageStream *stream)
 Emitted after a new StreamData arrived to signal main thread.
 

Public Member Functions

StreamSharedImageSet image (ImageStream *stream)
 Returns a scoped pointer to the SharedImageSet generated by the stream If this cache is already attached to the stream a scoped pointer to the existing SharedImageSet is returned.
 
ImageStreamstream (SharedImageSet *image)
 Returns the image stream a cache image set is attached to, or nullptr if there is none.
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Static Public Member Functions

static ImageStreamCacheref ()
 Returns the singleton instance.
 

Additional Inherited Members

- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Member Function Documentation

◆ image()

StreamSharedImageSet image ( ImageStream * stream)

Returns a scoped pointer to the SharedImageSet generated by the stream If this cache is already attached to the stream a scoped pointer to the existing SharedImageSet is returned.

Otherwise this cache will connect to the stream and create a new SharedImageSet. Once all scoped references to the SharedImageSet are deleted, the SharedImageSet itself is deleted and the cache detached from the stream.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close