Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6377263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:50:54+00:00 2026-05-25T01:50:54+00:00

Is it possible to use an autogenerated class in the same run as it

  • 0

Is it possible to use an autogenerated class in the same run as it is being generated? I am trying to achieve something which works as a factory but for autogenerated classes. My scenario is like this:

I have files which specify what some resulting files can contain. These result files should then be used to calculate statistics or something other than that. Now I would like to modify the data when these are read but since the software does not know what parts are written to file, it does not know how to save the data in the files internally. I have a reader and writer (made by a friend and which are VERY genreric and too cumbersome to use). I figured that I could use the definitions to autogenerate classes/structs.

for instance:
classes which can be written are “A”, “B” and “C”. Say that “A” and “B” have two and three children respectively. Lets call these A0, A1, B0, B1,B2.

Now internally in the software, I would like to write:

A aObject = new A0();
aObject.variable1 = 2;
aObject.variable2 = "something";

B bObject = new B1();
bObject.SomeVariable = 42;
bObject.SomeOtherVariable = "someValue";

what the variables are called and what type the data represents is written in a specification file. In xml for instance, it would be something like:

<A0>
<Variable>
   <Name>variable1</Name>
   <type>int</type>
</Variable>
<Variable>
   <Name>variable2 </Name>
   <type>string</type>
</Variable>
</A0>

(same with A1, B0, B1, B2 and so on)

Now, I would like to read a result file, realize I would have to autogenerate A0, generate it, modify the data (with the class/struct A0 which was just created) and then write to file again.

My solution for this is to pregenerate all possible classes/structs beforehand and include them. Problem with this is that the versions of A, B and C are or will be changing.

All help is appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:50:55+00:00Added an answer on May 25, 2026 at 1:50 am

    The rest of your question did not make all that much sense to me to be honest, but to answer your very first question: yes you can do that. Have a look here for instance.

    Regards Gert-Jan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The original use case: This is a possible use case I'm trying to solve:
Question: Is it possible to (automatically) change the base class of auto-generated domain objects
what could be a possible use of declaring types within a namespace but not
When I use a simple array that i define in this class, it works
Is it possible use mod_rewrite to resolve addresses hosted on another server? Say I
I have recently started looking into Google Charts API for possible use within the
Possible Duplicate: Use SVN Revision to label build in CCNET I'm working through the
Is possible to use ArcSDE API in .NET(C#) ? http://edndoc.esri.com/arcsde/9.2/api/capi/dbconnects/dbconnects.htm Thanks
Is it possible to use a flash document embedded in HTML as a link?
Is it possible to use Apache Subversion (SVN) as general purpose backup tool? (As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.