can i insert msg in the head ( wxMessageQueue )
eg:
wxMessageQueue <int> msg;
msg={1,2,3,4,5}
now i want insert data 10 make msg={10,1,2,3,4,5};
can wxMessageQueue do this?
i just want the next msg.front=10;
or has some other class like as wxMessageQueue ,thread safe?
can i insert msg in the head ( wxMessageQueue ) Topic is solved
-
- In need of some credit
- Posts: 8
- Joined: Fri Dec 23, 2016 6:05 am
can i insert msg in the head ( wxMessageQueue )
I am genius and man will conquer the nature
-
- Experienced Solver
- Posts: 81
- Joined: Wed Oct 19, 2016 1:41 pm
Re: can i insert msg in the head ( wxMessageQueue )
According to the docs you can only append new message to the back of the wxMessageQueue class.
For thread-safe data, why not just use wxMutexLocker to lock shared data between different thread, which is more flexible than using wxMessageQueue(which is not designed to store custom user info and sort manipulation).
For thread-safe data, why not just use wxMutexLocker to lock shared data between different thread, which is more flexible than using wxMessageQueue(which is not designed to store custom user info and sort manipulation).
-
- Moderator
- Posts: 19163
- Joined: Fri Apr 21, 2006 8:03 pm
- Location: $FCE2
Re: can i insert msg in the head ( wxMessageQueue )
wxMessageQueue is a very small, header-only class defined in <wxdir>/include/msgqueue.h
You can copy that file to your own project, rename the class and then modify it.
You can copy that file to your own project, rename the class and then modify it.
Use the source, Luke!
-
- In need of some credit
- Posts: 8
- Joined: Fri Dec 23, 2016 6:05 am
Re: can i insert msg in the head ( wxMessageQueue )
yeah,that seems a good ideadoublemax wrote:wxMessageQueue is a very small, header-only class defined in <wxdir>/include/msgqueue.h
You can copy that file to your own project, rename the class and then modify it.
I am genius and man will conquer the nature