Get available structure members


#1

I’m not quite sure how to parse this, however, I know its possible to get a list of available methods, return values, and parameters with get_objects() or something similar to the code below. Which will print out the functions in the engine with return_type name(type-1, type-2 … type-n). Is it possible to print out exposed structure members? Such as I have a struct s { int a, int b, int c } where a and b are exposed is it possible to print out a list that shows struct s has members s.a and s.b available? The function below will print out the structure members but its rather hard to distinguish between them and an callable function. ie the function below would print out something like int a(struct s);, int b(struct s);

Basically I’m trying to find an easier way to document the engine or is there a better way to document a large, complex engine?

bool is_first_param;
for (const auto & objs : chai.get_state().engine_state.m_function_objects)
{
    is_first_param = true;
    auto paramList = objs.second->get_param_types();

    ::trace_no_new_line("%s %s (", paramList[0].name().c_str(), objs.first.c_str());
   
    for (const auto & param : paramList)
    {
        if (is_first_param)
        {
            is_first_param = false;
            continue; 
        }
        else
            ::trace_no_new_line("%s, ", param.name().c_str());
    }
    ::trace(")");
}