Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to update typeset on classes

Reply
Thread Tools

How to update typeset on classes

 
 
Josh McFarlane
Guest
Posts: n/a
 
      05-26-2005
I'm making a basic classes.
(snipped for simplicity)
class CWLRecord //Base Record Class
{
private:
CWLRecord *pNextRecord ; //Pointer to next record
} ;

then I take this base record class and define a record for each
different set of data I have. However, I want to make sure that when I
create an instance of the derived class CWLRecord_Foo, instead of
pNextRecord being a pointer of type CWLRecord, I want it class
CWLRecord_Foo to require a pointer of type CWLRecord_Foo. However, I
want to still be able to use functions from CWLRecord (such as WipeAll,
RetrieveNext, etc) to be able to use pNextRecord as a generic
CWLRecord. Can I do

class CWLRecord_Foo : public CWLRecord
{
private:
CWLRecord_Foo *pNextRecord
};

and have it work in the way I'd like it to? I just want to make sure
I'm not doing something fundamentally wrong.

Thanks,
Josh McFarlane

 
Reply With Quote
 
 
 
 
Josh McFarlane
Guest
Posts: n/a
 
      05-26-2005
> However, I want to make sure that when I
> create an instance of the derived class CWLRecord_Foo, instead of
> pNextRecord being a pointer of type CWLRecord, I want it class
> CWLRecord_Foo to require a pointer of type CWLRecord_Foo. However, I
> want to still be able to use functions from CWLRecord (such as WipeAll,
> RetrieveNext, etc) to be able to use pNextRecord as a generic
> CWLRecord.


Ok, that sounds confusing so let me simplify it.

CWLRecord is a base link-list class. I want to retain next node pointer
from the base class but when declaring an instance of a certain
recordset (CWLRecord_Foo), I want the pointer to the next Linklist item
to be restricted to those of type CWLRecord_Foo, but still able to use
functions from the base.

 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Update On The Windows Phone 7 Update Update Lawrence D'Oliveiro NZ Computing 2 02-25-2011 08:03 AM
aligning typeset graphics to text baselines Chris Chiasson HTML 10 12-06-2006 02:25 PM
Classes within classes David ASP .Net 2 07-22-2005 07:13 PM
How to access inner classes variables & methods from outer classes lonelyplanet999 Java 1 11-13-2003 01:54 PM



Advertisments