iterate through types in a library (reflection)

This is a discussion on iterate through types in a library (reflection) within the C++ Programming forums, part of the General Programming Boards category; hi, i was wondering if there's a way for C++ to iterator through all types in a library. i understand ...

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    188

    iterate through types in a library (reflection)

    hi, i was wondering if there's a way for C++ to iterator through all types in a library.

    i understand that RTTI is not as possible as reflection in java/c#, and there are some solutions that involve macros and the like, but assuming i don't have access to the original source code, and only have static libs, is it possible for me to look at the library programmatically and determine what types there are?

    thanks.

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,230
    http://www.garret.ru/cppreflection/docs/reflect.html

    Long story short, it's not straightforward and not portable. One possibility is to dump the symbols from the library and demangle the names, this will at least get you the type names and method signatures of all the public types and functions in the library.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Library Wrapper
    By cusavior in forum C Programming
    Replies: 3
    Last Post: 03-25-2008, 10:27 AM
  2. Difficulty choosing graphics library
    By jdiperla in forum Game Programming
    Replies: 11
    Last Post: 02-27-2008, 05:35 PM
  3. link with C runtime library
    By George2 in forum C++ Programming
    Replies: 26
    Last Post: 02-05-2008, 12:56 AM
  4. Global variable in shared library
    By krock923 in forum C Programming
    Replies: 5
    Last Post: 01-11-2008, 03:56 PM
  5. Network Library
    By CornedBee in forum C++ Programming
    Replies: 2
    Last Post: 05-21-2005, 09:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21