Set enum data with Dynamic Data api

3 posts / 0 new
Last post
Last seen: 4 years 4 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: 1 week 3 days ago
Joined: 04/23/2014
Posts: 57

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: 3 days 10 hours 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.