Set enum data with Dynamic Data api

3 posts / 0 new
Last post
Last seen: 1 year 3 months ago
Joined: 05/21/2014
Posts: 46
Set enum data with Dynamic Data api

I know you can use the dyanmic data API to set and int and those types, I am however wondering if you can use the dynamic data api to set an enum?

Last seen: 2 months 3 days ago
Joined: 04/23/2014
Posts: 51

Hi jgr208,

I hope the attached example can help you. This example creates a struct which contains an enum with 2 types; Foo = 0; Bar = 1. Then it prints the representation of them, which is:

enum FooEnum { Foo = 0, Bar = 1};

struct OuterStruct { FooEnum enum_inside_struct; };



File Attachments: 
rip's picture
Last seen: 13 hours 55 min ago
Joined: 04/06/2012
Posts: 324

I believe the question was how to use the DynamicData setters and getters to set and get the values of an enum inside a DynamicData struct.

@jgr:  yes, Enum are treated as primitive long values, so use the long (32bit) setter and getter to write/read the enum values.