Is it possible to make a multi-instance table of a struct Base with a couple of virtual methods, and then store entries of derived classes and have it be able to differentiate? So ie:
struct animal {
virtual void make_noise();
}
struct dog : animal {
void make_noise() { print "woof!"; }
}
multi_index<N(animals), animal> animals;
and then somehow store an entry that would somehow know how to "woof!" upon retrival?
Or perhaps store a type with a whole other type as field which would implicitly have the correct method so:
struct container {
animal myanimal
}
dog mydog;
container c;
c.animal = mydog;
multi_index<N(animals), container> animals;
animals.emplace(get_self(), [](auto a) {
a.animal = c.animal;
});
Or are the fields of a multi-index table limited to basic types such as string, uint16_t etc? Thanks