Monkey StringMap in C++

Monkey Forums/Monkey Beginners/Monkey StringMap in C++

k.o.g.(Posted 2014) [#1]
Hello All

Is there any chance, to use Monkey StringMaps in C++ for a Module?


Like:
C++
Class cppTest
{
  brl_StringMap fields;

  cppTest(){};
  ~cppTest(){};
};

Monkey
extern
Class Test = "cppTest"
  Field fields:StringMap
End

public


Thanks for your help.


k.o.g.(Posted 2014) [#2]
@marksibly

Any idea?


Gerry Quinn(Posted 2014) [#3]
I suppose in theory you can do anything you want in C++, but you'd have to check out the data structures in monkey.map and it might be more trouble than its worth.


Goodlookinguy(Posted 2014) [#4]
In release mode Monkey names all of the classes, methods, fields, etc. as numbers. So I don't think it's realistically possible unless you release things in debug mode.

Edit: I hope I'm right here, as I just thought about it and maybe I was thinking of reflection. Hmm...whatever. I'm in bed, I need to sleep.


AdamRedwoods(Posted 2014) [#5]
Monkey names in c++ are generated automatically, so you cannot rely on what the name will be in the actual c++ code.
That said, you could extend the class and name it something unique, and the generated name usually will stay the same.


Gerry Quinn(Posted 2014) [#6]
I wasn't thinking of anything like that, I was thinking that a class might have a stringmap field, and at the end if the day that field is data to be interpreted.


k.o.g.(Posted 2014) [#7]
@Gerry Quinn

This was the same idea as mine.