Are TQueue UProperties not supported?

I’m trying to make a plugin in the engine. I was hoping to expose some structures like this to the blueprint system but the compiler wont go past this line.

UPROPERTY(BlueprintReadOnly, AdvancedDisplay, Category = "Debug")
TQueue<float> FirstHistory;

I get Unrecognized type ‘TQueue’ unless I remove the UProperty.
I actually Prefer the following but I suppose can live with a manual break down:

    UPROPERTY(BlueprintReadOnly, AdvancedDisplay, Category = "Debug")
    TArray<TQueue<float>> AllHistory;

Is there a work around? or what am I doing wrong?

oh and for the record if anyone else cares, this is also not supported

TArray<TArray<float>> 

At least this one gives a nice error message

It means it is not exposed to code reflection, and there are two possible options:

  1. Expose to code reflection on your own.

  2. Bogger people to do it for you, as by any means it won’t be trivial task.

I had a feeling, Thanks!

Try TArray >
Note the white space between the closing brackets. That worked out for me with encapsulated generics.

maybe the webpage swallowed what you were typing. all i see is TArray >

Oh yeah sry, simply make a whitespace between the last two closing brackets

Thanks, but that didnt work. What i’m doing to work around it is to use the structure anyway ( because it does compile without the UProperty,) but I also make a function with parameters to access the data. more work but whatever.

Creating a TQueue as a UPROPERTY() is currently not supported, but there are some things you can do if you want to expose it’s functionality and values to Blueprints and Serialization. First and foremost, understand what TQueue’s intended use is for. It is a thread safe concurrent Queue of elements that can be enqueued and dequeued from on multiple threads.

Should give you all the search terms you will need to fully understand its function. If you just want a FIFO or a Stack, using the standard TArray is likely a better option, and more optimal.
For Blueprints:

  1. Create a USTRUCT() or UCLASS() that will encapsulate the TQueue, for the purposes of illustration this will go over making the USTRUCT()
  2. Ensure that you have the correct specifiers to make this a blueprint struct
  3. Add a TQueue of the desired type as a member, then write several public functions to wrap it’s functions if it is a private member ie. Enqueue(), Dequeue(), IsEmpty(), and Empty()
  4. If it is a public member or you have already exposed the functionality with public functions on your USTRUCT() add a few static UFUNCTION() functions to a blueprint function library to expose it to blueprints.
  5. You are done, your custom USTRUCT can now be interacted with in blueprints the same way c++ iteracts with the TQueue.
    For serialization:
    Simply ensure you add a TArray UPROPERTY to your custom struct that will hold all of the same data the TQueue holds, then when the serializer looks for data, it can find it there, on deserialization you can find the data from that TArray and enqueue it all to the TQueue at that time.
    I hope you found this post illuminating. Please ask any questions you may still have.

~Spiris

Great tip! Thank you!