Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Editing a parameter while creating a sub-class?

Reply
Thread Tools

Editing a parameter while creating a sub-class?

 
 
Steve555
Guest
Posts: n/a
 
      03-20-2007
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

 
Reply With Quote
 
 
 
 
amparikh@gmail.com
Guest
Posts: n/a
 
      03-20-2007
On Mar 20, 10:02 am, "Steve555" <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
 
Steve555
Guest
Posts: n/a
 
      03-20-2007
On 20 Mar, 17:13, (E-Mail Removed) wrote:
> On Mar 20, 10:02 am, "Steve555" <(E-Mail Removed)> wrote:
>
>
>
> > 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Are you looking for high quality photo editing and video editing? gwanglu@gmail.com C Programming 0 07-19-2006 12:32 PM
Why databind is required while editing datagrid? =?Utf-8?B?QWF5dXNoIFB1cmk=?= ASP .Net 1 03-19-2005 10:21 PM
Update problem while editing text field + populate checkbox value from table Nithin ASP .Net 0 12-31-2003 09:30 PM
Update problem while editing text field + populate checkbox value from table Nithin ASP .Net 0 12-31-2003 09:30 PM
Updating DataGrid while editing, doesn't update Jeff Petter ASP .Net 1 10-17-2003 04:55 AM



Advertisments