Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. FIFO Queue or Stack with peek option?

FIFO Queue or Stack with peek option?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 307 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    I'm looking for a Queue or Stack that has a peek option, what I mean by this is I want to look at the next location that could be popped off but leave it in the Queue until such time as I have verified that the item I've retrieved has been successfully used.

    To give context. The Queue is a list of items to transmit, I want to only take them out of the queue once they have been successfully transmitted.

    I've looked at both QQueue and QStack and both have very similar functionality but neither seem to have the option to read an item without removing it from its place in the object.

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by Kent-Dorfman
      #2

      if you look at std::deque you will see items to examine the front and back without actually popping them. in fact object removal is a discrete operation...so at any given time you could track the last popped item and the current item existing on either end of the list.

      and what about QQueue::head() ?

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved