How to get the effective definitions of classes

Discussion in 'C++' started by James Harris, Jun 5, 2012.

  1. James Harris

    James Harris Guest

    Am fairly new to C++ and trying to understand the class hierarchy of
    an existing body of code that I have to work with. The way the code is
    defined (many files, significantly deep class hierarchy and
    conditional includes) makes it especially difficult to work out what
    the classes I have to work with actually look like.

    Any suggestions on how to understand the effective make-up of
    individual classes and how the class hierarchy is put together?

    Maybe there is a tool to do this. g++'s -fdump-class-hierarchy seems
    more about vtables. All I want to see is something along the lines of

    class C
    member variable V
    member variable V
    member function F
    member function F

    etc. and for each member a note of its type and where it is defined.

    Anyone know of a way to get this info?

    James
    James Harris, Jun 5, 2012
    #1
    1. Advertising

  2. James Harris

    Jorgen Grahn Guest

    On Tue, 2012-06-05, James Harris wrote:
    > Am fairly new to C++ and trying to understand the class hierarchy of
    > an existing body of code that I have to work with. The way the code is
    > defined (many files, significantly deep class hierarchy and
    > conditional includes)


    Unless they're doing really bizarre things (like having
    myclass_version_one.h and myclass_alternate_version.h),
    conditional includes shouldn't affect anything here.
    They do make navigation harder for humans though.

    > makes it especially difficult to work out what
    > the classes I have to work with actually look like.
    >
    > Any suggestions on how to understand the effective make-up of
    > individual classes and how the class hierarchy is put together?
    >
    > Maybe there is a tool to do this. g++'s -fdump-class-hierarchy seems
    > more about vtables. All I want to see is something along the lines of
    >
    > class C
    > member variable V
    > member variable V
    > member function F
    > member function F
    >
    > etc. and for each member a note of its type and where it is defined.
    >
    > Anyone know of a way to get this info?


    I tend to use Doxygen on code I'm unfamiliar with. Make it generate
    HTML documentation with class diagrams as pictures.

    Then when I know the code a bit better, I use pen and paper.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
    Jorgen Grahn, Jun 5, 2012
    #2
    1. Advertising

  3. James Harris wrote:

    > Any suggestions on how to understand the effective make-up of
    > individual classes and how the class hierarchy is put together?
    >
    > Maybe there is a tool to do this. g++'s -fdump-class-hierarchy seems
    > more about vtables. All I want to see is something along the lines of
    >
    > class C
    > member variable V
    > member variable V
    > member function F
    > member function F
    >
    > etc. and for each member a note of its type and where it is defined.
    >
    > Anyone know of a way to get this info?


    Try Doxygen <http://www.stack.nl/~dimitri/doxygen/>. It's a
    documentation tool that can extract information like this.

    Gerhard
    Gerhard Fiedler, Jun 5, 2012
    #3
  4. James Harris

    James Harris Guest

    On Jun 5, 12:58 pm, Gerhard Fiedler <> wrote:
    > James Harris wrote:
    > > Any suggestions on how to understand the effective make-up of
    > > individual classes and how the class hierarchy is put together?

    >
    > > Maybe there is a tool to do this. g++'s -fdump-class-hierarchy seems
    > > more about vtables. All I want to see is something along the lines of

    >
    > >   class C
    > >     member variable V
    > >     member variable V
    > >     member function F
    > >     member function F

    >
    > > etc. and for each member a note of its type and where it is defined.

    >
    > > Anyone know of a way to get this info?

    >
    > Try Doxygen <http://www.stack.nl/~dimitri/doxygen/>. It's a
    > documentation tool that can extract information like this.


    Doxygen looks very good. Thanks for both the replies.

    James
    James Harris, Jun 5, 2012
    #4
  5. James Harris

    Jamie Guest

    "effective"? "definition of classes"? Hitler is dead, but SS lives?
    Jamie, Jul 15, 2012
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Buick

    Effective Email Marketing

    Joe Buick, Nov 29, 2004, in forum: VHDL
    Replies:
    0
    Views:
    446
    Joe Buick
    Nov 29, 2004
  2. Carfield Yim
    Replies:
    1
    Views:
    1,391
    Andrew Thompson
    May 31, 2004
  3. Replies:
    7
    Views:
    25,883
    dagger007
    Mar 24, 2008
  4. Oplec
    Replies:
    1
    Views:
    346
    alex wang
    Oct 27, 2003
  5. vimala
    Replies:
    1
    Views:
    566
    Jack Klein
    Aug 1, 2003
Loading...

Share This Page