comparison transform/ModelTransformer.h @ 876:47aa3aeb687b tonioni

For outputs with unknown bin count or multiple bins with variable sample rate, create additional output models for bins beyond the first
author Chris Cannam
date Wed, 29 Jan 2014 09:31:22 +0000
parents 418cd2064769
children b109b88bfa85
comparison
equal deleted inserted replaced
875:3e6ed8a8577b 876:47aa3aeb687b
81 * Return the set of output models created by the transform or 81 * Return the set of output models created by the transform or
82 * transforms. Returns an empty list if any transform could not 82 * transforms. Returns an empty list if any transform could not
83 * be initialised; an error message may be available via 83 * be initialised; an error message may be available via
84 * getMessage() in this situation. 84 * getMessage() in this situation.
85 */ 85 */
86 Models getOutputModels() { return m_outputs; } 86 Models getOutputModels();
87 87
88 /** 88 /**
89 * Return the set of output models, also detaching them from the 89 * Return the set of output models, also detaching them from the
90 * transformer so that they will not be deleted when the 90 * transformer so that they will not be deleted when the
91 * transformer is. The caller takes ownership of the models. 91 * transformer is. The caller takes ownership of the models.
92 */ 92 */
93 Models detachOutputModels() { m_detached = true; return m_outputs; } 93 Models detachOutputModels() { m_detached = true; return getOutputModels(); }
94 94
95 /** 95 /**
96 * Return a warning or error message. If getOutputModel returned 96 * Return a warning or error message. If getOutputModel returned
97 * a null pointer, this should contain a fatal error message for 97 * a null pointer, this should contain a fatal error message for
98 * the transformer; otherwise it may contain a warning to show to 98 * the transformer; otherwise it may contain a warning to show to
102 102
103 protected: 103 protected:
104 ModelTransformer(Input input, const Transform &transform); 104 ModelTransformer(Input input, const Transform &transform);
105 ModelTransformer(Input input, const Transforms &transforms); 105 ModelTransformer(Input input, const Transforms &transforms);
106 106
107 /**
108 * Return any additional models that were created during
109 * processing. This might happen if, for example, a transform was
110 * configured to split a multi-bin output into separate single-bin
111 * models as it processed.
112 */
113 virtual Models getAdditionalOutputModels() { return Models(); }
114
107 Transforms m_transforms; 115 Transforms m_transforms;
108 Input m_input; // I don't own the model in this 116 Input m_input; // I don't own the model in this
109 Models m_outputs; // I own this, unless... 117 Models m_outputs; // I own this, unless...
110 bool m_detached; // ... this is true. 118 bool m_detached; // ... this is true.
111 bool m_abandoned; 119 bool m_abandoned;