From: Roy Stogner <roystgnr@ic...> - 2012-08-07 17:56:35
On Tue, 7 Aug 2012, Jens Lohne Eftang wrote:
> Is there a way to remove a vector from a system, by name, when this
> vector has already been added to a system with add_vector("my_vector") ?
Currently no. But System::remove_vector() implementations shouldn't
be too hard to add; if you want to send us a patch we'll get it into
the svn trunk.
From: Roy Stogner <roystgnr@ic...> - 2012-08-12 07:13:34
On Sat, 11 Aug 2012, Jens Lohne Eftang wrote:
> Attached is the patch that I use to remove a vector (it implements
> System::remove_vector() ). Please feel free to add it to the trunk.
Why did you remove the _vector_types.clear() around system.C:215?
Otherwise the patch looks good. I should be able to commit it once I
understand the above. Thanks!
> I have a related question regarding adding vectors. In the comments above
> add_vector in system.h it says a vector cannot be added after init(), in
> which _can_add_vectors is set to false. But there's nothing in add_vector
> that checks whether _can_add_vectors is true or false...
Check around system.C:683 - if _can_add_vectors is false, then new
vectors have to be initialized as soon as they're added, rather than
waiting to allocate them all together in System::init()
The comments in system.h are a bit out of date - originally we
*couldn't* add vectors except before init(), but that limitation has
been fixed for a while. I'll update the comments to match; thanks for
From: Roy Stogner <roystgnr@ic...> - 2012-08-12 17:14:52
On Sun, 12 Aug 2012, Jens Lohne Eftang wrote:
> No good explanation re _vector_types.clear(). Thanks for pointing it out.
I've committed the rest of the patch; try out the svn head and make
sure it still works?
Get latest updates about Open Source Projects, Conferences and News.