-1

I have a property that is a structure in eclipse. How do I call the listener to know that a specific field was changed within the structure. Likewise, if I have a property that is a sequence of structures, how do I know which structure changed and which field within the structure changed.

I'm using C++ in Linux.

The structure property is named MyStruct. The member fields are MyField1 and MyField2. I'm using

setPropertyChangeListener("MyStruct", this, &MyComponent_i::myStrutChanged);

setPropertyChangeListener("MyStruct.MyField1", this, &MyComponent_i::myStructField1Changed);

setPropertyChangeListener("MyStruct.MyField2", this, &MyComponent_i::myStructField2Changed);

If a field is changed, setPropertyChangeListener("MyStruct", this, &MyComponent_i::myStrutChanged) is called. I need to know which field changed.

I also have a property that is a sequence of sturctures named MySeq. The structure has 2 member fields name SeqField1 and SeqField2. I'm using

setPropertyChangeListener("MySeq", this, &MyComponent_i::mySeqChanged);

setPropertyChangeListener("MySeq[1]", this, &MyComponent_i::mySeqChanged_1);

setPropertyChangeListener("MySeq[1].SeqField1", this, &MyComponent_i::mySeqChanged_1_field1);

setPropertyChangeListener("MySeq[1].SeqField2", this, &MyComponent_i::mySeqChanged_1_field2);

If a field in one of the structures is changed, setPropertyChangeListener(""MySeq", this, &MyComponent_i::mySeqChanged) is called. I need to know which structure was changed and which field within the structure was changed.

Cat
  • 63
  • 1
  • 8

1 Answers1

0

I would recommend that you create a private member variable of the struct type that you can compare with the incoming (changed) struct. You then can step through the fields to determine which field changed.

mdl
  • 30
  • 2
  • Thanks for looking at my question. My code already does as you suggested, but I'm looking for an automatic, fast way of doing this since my application needs to be fast. – Cat Oct 30 '14 at 17:12