I have a Hashtable object which "names" or "map" various fields in a class with a string
ref class Interrupt{
Interrupt(){
this->type = 0;
this->size = 0;
}
int type;
int size;
}
Interrupt^ interrupt = gcnew Interrupt();
Hashtable^ map = gcnew Hashtable();
map->Add("InterruptType", interrupt->type);
map->Add("InterruptSize", interrupt->size);
this class is modified during runtime so type and size are both equals to 2.
further down the road I query my Hashtable but the values didn't change. I understand that it is because they are immutable. Is there a way I can specify my Hashtable to hold pointers to the fields of my class instead of storing the value of the reference?
I know I can modify class Interrupt to hold custom objects instead of raw int, but it would invole A LOT of refactoring.