Set enum data with Dynamic Data api

3 posts / 0 new
Last post
Offline
Last seen: 4 years 2 weeks 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?

Offline
Last seen: 2 months 1 week 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; };

Angel.

 

File Attachments: 
rip
rip's picture
Offline
Last seen: 14 hours 48 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.