Set enum data with Dynamic Data api

3 posts / 0 new
Last post
Offline
Last seen: 1 year 7 months ago
Joined: 05/21/2014
Posts: 45
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?

Offline
Last seen: 8 months 2 weeks ago
Joined: 04/23/2014
Posts: 45

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; };

Angel.

 

File Attachments: 
rip
rip's picture
Offline
Last seen: 1 day 7 hours ago
Joined: 04/06/2012
Posts: 316

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.