Thread: Group Of Methods

  1. #1
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669

    Question Group Of Methods

    Hi!

    Anyone knows how can you make a group of methods in a .hpp file in C++?

    And when you use this header file it looks like this ...

    Code:
    Support s;
    
    s.IO.read(buffer);
    s.MEMORY.delete(buffer);
    So, how to create IO and MEMORY in hpp file?

    Thanks!
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    a class 'Support' with public sub-classes 'Io' and 'Memory'?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669
    Yes, something like that. But, is that good programming?
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  4. #4
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Well, if you do need to do that for clarity in your code, I'd really consider it poor design. Granted, there are quite valid reasons for having nested classes, but I would not consider this separation one of them. Perhaps your class interface is not high-level enough, and what you have as multiple tasks could be included as one function (perhaps implemented by separate classes under the hood).
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  2. Lesson #5 - Methods
    By oval in forum C# Programming
    Replies: 1
    Last Post: 05-04-2006, 03:09 PM
  3. ray casting
    By lambs4 in forum Game Programming
    Replies: 62
    Last Post: 01-09-2003, 06:57 PM
  4. Group
    By knight543 in forum C++ Programming
    Replies: 2
    Last Post: 01-11-2002, 02:16 PM