By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,925 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,925 IT Pros & Developers. It's quick & easy.

Editing a parameter while creating a sub-class?

P: n/a
Hi,

I'm creating an object CSub, which is sub-classed from CMaster.

The constructor for either takes a struct as an argument:

CSub:: CSub(BasicModel *inModel : CMaster(inModel)

and this is the struct:

typedef struct{
long size;
long numVertices;
long numTris;
}BasicModel;
What I want to do is edit some inModel parameters for creating a
CSub, before passing it on to the CMaster constructor.

Is there a way to do this?

Thanks

Steve

Mar 20 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mar 20, 10:02 am, "Steve555" <foursh...@btinternet.comwrote:
Hi,

I'm creating an object CSub, which is sub-classed from CMaster.

The constructor for either takes a struct as an argument:

CSub:: CSub(BasicModel *inModel : CMaster(inModel)

and this is the struct:

typedef struct{
long size;
long numVertices;
long numTris;

}BasicModel;

What I want to do is edit some inModel parameters for creating a
CSub, before passing it on to the CMaster constructor.

Is there a way to do this?

Thanks

Steve
This article might help you.

http://www.ddj.com/dept/cpp/184403887

Mar 20 '07 #2

P: n/a
On 20 Mar, 17:13, ampar...@gmail.com wrote:
On Mar 20, 10:02 am, "Steve555" <foursh...@btinternet.comwrote:
Hi,
I'm creating an object CSub, which is sub-classed from CMaster.
The constructor for either takes a struct as an argument:
CSub:: CSub(BasicModel *inModel : CMaster(inModel)
and this is the struct:
typedef struct{
long size;
long numVertices;
long numTris;
}BasicModel;
What I want to do is edit some inModel parameters for creating a
CSub, before passing it on to the CMaster constructor.
Is there a way to do this?
Thanks
Steve

This article might help you.

http://www.ddj.com/dept/cpp/184403887
Yes, it did, thanks. Though after reading how they did it, it occured
to me it I could also just create a wrapper function to create the sub-
class, after first editing the parameter.

Mar 20 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.