How to use TCircularQueue?

Hello. How do I use TCircularQueue properly? I’m trying to create a circular buffer full of FVector2D array variables to send to the server for move replication. This is all I have so far:

TCircularQueue<FVector[]> InputBufferAxis;

I have no idea how to call the Enqueue and Dequeue functions. Also I can’t seem to specify a FVector2D as it’s ElementType, only FVector.

Any help with these issues would be much appreciated!

-Headstub

I was wondering same and after some time I finally got it working.

I just managed to create a TCircularQueue variable:

TCircularQueue<FVector2D> InputBufferAxis = TCircularQueue<FVector2D>(64);

64 is the max amount of items that can be placed in the queue. Keep in mind that we can actually store 63 elements since there must be always at least one hole to keep track of where the queue starts and finishes. If you look the TCircularQueue source it says max elements will be always rounded up to next power of 2.

If you want to create a queue of arrays of FVector2D I suggest using TArray:

TCircularQueue<Tarray<FVector2D>> InputBufferAxis = TCircularQueue<Tarray<FVector2D>>(64);

Ah I see, thank you. Sorry for the late response. I posted this a while back and got no response, so I forgot about the thread. I’ll definitely try out TArray, thanks!