creating user defined classes on fly, runtime C++

Discussion in 'C Programming' started by rocky_mfe, Jan 9, 2012.

  1. rocky_mfe

    rocky_mfe

    Joined:
    Jan 9, 2012
    Messages:
    1
    I have a query, I have set of flat files ( say file1, file2 etc) containing column names and native data types. ( how values are stored and can be read in c++ is elementary)
    eg. flat file file1 may have data like
    col1_name=id, col1_type=integer, col2_name=Name, col2_type=string and so on.

    So for each flat file I need to create C++ data structure ( i.e 1 flat file = 1 data structure) where the member variable name is same name as column name and its data type will be of C++ native data type like int, float, string etc. according to column type in flat file.
    from above eg: my flat file 1 should give me below declaration
    class file1{
    int id;
    string Name;
    };


    Is there a way I can write code in C++, where binary once created will read the flat file and create data structure based on the file ( class name will be same as flat file name). All the classes created using these flat files will have common functionality of getter and setter member functions.

    Do let me know if you have done something similar earlier or have any idea for this.
    rocky_mfe, Jan 9, 2012
    #1
    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. Steven T. Hatton

    C++ Runtime Defined Classes?

    Steven T. Hatton, Apr 1, 2004, in forum: C++
    Replies:
    6
    Views:
    796
    Steven T. Hatton
    Apr 2, 2004
  2. Carlos Ribeiro

    Creating new classes on the fly

    Carlos Ribeiro, Oct 5, 2004, in forum: Python
    Replies:
    5
    Views:
    342
    brian
    Oct 12, 2004
  3. Oodini
    Replies:
    1
    Views:
    1,735
    Keith Thompson
    Sep 27, 2005
  4. jmike@alum.mit.edu
    Replies:
    1
    Views:
    474
    Sion Arrowsmith
    Jul 10, 2008
  5. Brian

    Fly outmenu on the fly

    Brian, Apr 8, 2005, in forum: Javascript
    Replies:
    0
    Views:
    86
    Brian
    Apr 8, 2005
Loading...

Share This Page