comparison framework/Document.h @ 371:dfcc5b355f33

Merge from branch warnfix_no_size_t
author Chris Cannam
date Wed, 18 Jun 2014 13:51:38 +0100
parents f5c914661f6f
children 662aef012679
comparison
equal deleted inserted replaced
355:e7a3fa8f4eec 371:dfcc5b355f33
126 * the same order as the transforms are supplied. 126 * the same order as the transforms are supplied.
127 */ 127 */
128 std::vector<Layer *> createDerivedLayers(const Transforms &, 128 std::vector<Layer *> createDerivedLayers(const Transforms &,
129 const ModelTransformer::Input &); 129 const ModelTransformer::Input &);
130 130
131 typedef void *LayerCreationAsyncHandle;
132
131 class LayerCreationHandler { 133 class LayerCreationHandler {
132 public: 134 public:
133 virtual ~LayerCreationHandler() { } 135 virtual ~LayerCreationHandler() { }
134 136
135 /** 137 /**
136 * The primary layers are those corresponding 1-1 to the input 138 * The primary layers are those corresponding 1-1 to the input
137 * models, listed in the same order as the input models. The 139 * models, listed in the same order as the input models. The
138 * additional layers vector contains any layers (from all 140 * additional layers vector contains any layers (from all
139 * models) that were returned separately at the end of 141 * models) that were returned separately at the end of
140 * processing. 142 * processing. The handle indicates which async process this
143 * callback was initiated by. It must not be used again after
144 * this function returns.
141 */ 145 */
142 virtual void layersCreated(std::vector<Layer *> primary, 146 virtual void layersCreated(LayerCreationAsyncHandle handle,
147 std::vector<Layer *> primary,
143 std::vector<Layer *> additional) = 0; 148 std::vector<Layer *> additional) = 0;
144 }; 149 };
145 150
146 /** 151 /**
147 * Create suitable layers for the given transforms, which must be 152 * Create suitable layers for the given transforms, which must be
148 * identical apart from the output (i.e. must use the same plugin 153 * identical apart from the output (i.e. must use the same plugin
149 * and configuration). This method returns after initialising the 154 * and configuration). This method returns after initialising the
150 * transformer process, and the layers are returned through a 155 * transformer process, and the layers are returned through a
151 * subsequent call to the provided handler (which must be non-null). 156 * subsequent call to the provided handler (which must be
152 */ 157 * non-null). The handle returned will be passed through to the
153 void createDerivedLayersAsync(const Transforms &, 158 * handler callback, and may be also used for cancelling the task.
154 const ModelTransformer::Input &, 159 */
155 LayerCreationHandler *handler); 160 LayerCreationAsyncHandle createDerivedLayersAsync(const Transforms &,
161 const ModelTransformer::Input &,
162 LayerCreationHandler *handler);
163
164 /**
165 * Indicate that the async layer creation task associated with the
166 * given handle should be cancelled. There is no guarantee about
167 * what this will mean, and the handler callback may still be
168 * called.
169 */
170 void cancelAsyncLayerCreation(LayerCreationAsyncHandle handle);
156 171
157 /** 172 /**
158 * Delete the given layer, and also its associated model if no 173 * Delete the given layer, and also its associated model if no
159 * longer used by any other layer. In general, this should be the 174 * longer used by any other layer. In general, this should be the
160 * only method used to delete layers -- doing so directly is a bit 175 * only method used to delete layers -- doing so directly is a bit