162 | | serializePlugVector( Glib::ustring basePath, |
---|
163 | | Util::IOSerialize& ser, |
---|
164 | | const PlugVector& vec ) |
---|
165 | | { |
---|
166 | | bool result = true; |
---|
167 | | int i = 0; |
---|
168 | | for ( PlugVector::const_iterator it = vec.begin(); |
---|
169 | | it != vec.end(); |
---|
170 | | ++it ) |
---|
171 | | { |
---|
172 | | std::ostringstream strstrm; |
---|
173 | | strstrm << basePath << i; |
---|
174 | | result &= ser.write( strstrm.str(), ( *it )->getGlobalId() ); |
---|
175 | | i++; |
---|
176 | | } |
---|
177 | | return result; |
---|
178 | | } |
---|
179 | | |
---|
180 | | bool |
---|
181 | | deserializePlugVector( Glib::ustring basePath, |
---|
182 | | Util::IODeserialize& deser, |
---|
183 | | AVC::Unit& unit, |
---|
184 | | PlugVector& vec ) |
---|
185 | | { |
---|
186 | | int i = 0; |
---|
187 | | bool bFinished = false; |
---|
188 | | bool result = true; |
---|
189 | | do { |
---|
190 | | plug_id_t plugId; |
---|
191 | | std::ostringstream strstrm; |
---|
192 | | strstrm << basePath << i; |
---|
193 | | |
---|
194 | | if ( deser.isExisting( strstrm.str() ) ) { |
---|
195 | | result &= deser.read( strstrm.str(), plugId ); |
---|
196 | | AVC::Plug* pPlug = unit.getPlugManager().getPlug( plugId ); |
---|
197 | | |
---|
198 | | if ( result && pPlug ) { |
---|
199 | | vec.push_back( pPlug ); |
---|
200 | | i++; |
---|
201 | | } else { |
---|
202 | | bFinished = true; |
---|
203 | | } |
---|
204 | | } else { |
---|
205 | | bFinished = true; |
---|
206 | | } |
---|
207 | | } while ( !bFinished ); |
---|
208 | | |
---|
209 | | return result; |
---|
210 | | } |
---|
211 | | |
---|
212 | | bool |
---|