Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [4diac-dev] 回复: CSinglyLinkedList improvements

So there are no more platforms that doesn't support STL?

In that case I would also consider std::list as a direct replacement. Unlike std::vector it has constant insertion/removal time, and I expect it to minimize memory fragmentation on embedded devices. Of course, if random access is required then std::vector is preferred.

Has anyone considered boost? I know it's often times avoided, but it has some more embedded friendly implementations. I.e. lists with static allocation. But I never had an opportunity to work with it so I don't have any experience with it.

I also have some other suggestions:

  • use std::thread and synchronization mechanisms from STL, that can be ported to embedded devices with not too much effort
  • use std::chrono - in the current implementation I never know what time unit to expect. And I know I'm not the only one because of a bug in OPC UA I found some time ago.

On 4/29/22 10:08, Martin Melik-Merkumians wrote:

it should be rather straight forward, as I tried to mimic the std containers back then when I implemented the CSinglyLinkedList.

Best regards,

Dipl.-Ing. Martin Melik-Merkumians
Advanced Mechatronic Systems
Automation and Control Institute (ACIN)
TU Wien
DVR-Number: 0005886

Gusshausstr. 27-29, room CD-04-24
1040 Vienna, Austria
Phone: +43 (0)1 588 01 37688
Fax: +43 (0)1 588 01 937688
Email: melik-merkumians@xxxxxxxxxxxxxxxxx

-----Ursprüngliche Nachricht-----
Von: 4diac-dev <4diac-dev-bounces@xxxxxxxxxxx> Im Auftrag von zhaoxin@xxxxxxxxxxxxxxxxx
Gesendet: Freitag, 29. April 2022 10:06
An: alois.zoitl@xxxxxx; '4diac developer discussions' <4diac-dev@xxxxxxxxxxx>
Betreff: [4diac-dev] 回复: CSinglyLinkedList improvements


I guess we'd better move to std::vector instead of update CSinglyLinkedList.

I have done that for OPC DA module. It seems doable. 


发件人: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx> 代表 Alois Zoitl
发送时间: 2022年4月29日 3:37
收件人: 4diac developer discussions <4diac-dev@xxxxxxxxxxx>
主题: Re: [4diac-dev] CSinglyLinkedList improvements

Hi Davor,

thanks for looking on our code and trying to improve it. We have this single list implementation because when we started 4diac FORTE we had platforms that had no STL available. Now this is obsolete and my personal goal is to get rid of it step by step. 

Therefore my suggestion is no new code should use CSinglyLinkedList anymore. Better use std:vector.

Therefore I'm also not sure if it makes sense to spend time on improving it. What are you or others thinking.


On Thu, 2022-04-28 at 21:30 +0200, Davor Cihlar wrote:
Hi again!
Since Forte moved to c++11 I'm using the new features in my PostgreSQL implementation. To be able to use std::move properly I've upgraded CSinglyLinkedList.
I would like to contribute those changes, but first I think it would make sense to know nobody else is working on this?

While I was at it, I also noticed some irregularities in the 
implementation. In a few places const is not used properly. I.e.
CSinglyLinkedList::begin()const is returning a const Iterator - an Iterator that can only stay in one place! Instead of returning a non-const Iterator that handles const data. At some point I actually had a problem with that.
It appears that this doesn't matter for the whole Forte code, but it still should probably be fixed. On the other hand this may be a bit more work.

Now, before making any contributions, I also need to figure out first how unit testing is set up on this project.
4diac-dev mailing list
To unsubscribe from this list, visit
4diac-dev mailing list
To unsubscribe from this list, visit

4diac-dev mailing list
To unsubscribe from this list, visit
4diac-dev mailing list
To unsubscribe from this list, visit

Back to the top