Skip to contentSkip to conversation

C++ class inheritance

DISCUSSION Rafael Costa dos Santos 3 participants 4 messages Oct 2, 2003 – Oct 3, 2003

lore
Share & tools
lore
#0 lore raw

Can anyone explain me what does < > means ?
Example:

class RegistrationRequestPDU : public RasPDU<H225_RegistrationRequest> {
} ;

Is "RegistrationRequestPDU" inheriting from RasPDU, H225_RegistrationRequest or both ?

Signature · 2 lines
Rafael Costa dos Santos
[email protected]
#1 lore raw
Quoted 10 lines · Rafael Costa dos Santos

Can anyone explain me what does < > means ? Example:

class RegistrationRequestPDU : public RasPDU<H225_RegistrationRequest> {
} ;

Is "RegistrationRequestPDU" inheriting from RasPDU, H225_RegistrationRequest or both ?

RegistrationRequestPDU inherits from RasPDU using template H225_RegistrationRequest ?

Signature · 16 lines
Liviu Voicu
Assistant Programmer and network support
Computation Center, Mount Scopus
Hebrew University of Jerusalem
Tel: 972(2)-5881253
E-mail: "Liviu Voicu"<[email protected]>

/**
* cat /usr/src/linux/arch/i386/boot/bzImage > /dev/dsp
* ( and the voice of God will be heard! )
*
*/

Click here to see my GPG signature:
----------------------------------
	http://search.keyserver.net:11371/pks/lookup?template=netensearch%2Cnetennomatch%2Cnetenerror&search=pacman%40mscc.huji.ac.il&op=vindex&fingerprint=on&submit=Get+List
#2 lore raw

Ok, but as I am C ANSI programmer it is a bit dificult to underestand.

Are you saying that "RasPDU" is a general class that depends on the template (in this case "H225_RegistrationRequest") that is informed ?

Is it similar to create a specific class like:

class RasPDU : public H225_RegistrationRequest
{
} ;

and inherit from it ?

class RegistrationRequestPDU : public RasPDU
{
} ;

Quoted 13 lines · Voicu Liviu
Quoted 9 lines · Rafael Costa dos Santos

Can anyone explain me what does < > means ?
Example:

class RegistrationRequestPDU : public RasPDU<H225_RegistrationRequest> {
} ;

Is "RegistrationRequestPDU" inheriting from RasPDU, H225_RegistrationRequest or both ?

RegistrationRequestPDU inherits from RasPDU using template H225_RegistrationRequest ?

Signature · 2 lines
Rafael Costa dos Santos
[email protected]
#3 lore raw

You better get a C++ book or tutorial, I can recommend you "The C++
Programming Language" by Bjarne Stroustrup, 3rd Edition.
With templates you can parameterize types used in C++ constructs like
classes, structs or functions.

Quoted 34 lines · Rafael Costa dos Santos

Ok, but as I am C ANSI programmer it is a bit dificult to underestand.

Are you saying that "RasPDU" is a general class that depends on the template (in this case "H225_RegistrationRequest") that is informed ?

Is it similar to create a specific class like:

class RasPDU : public H225_RegistrationRequest
{
} ;

and inherit from it ?

class RegistrationRequestPDU : public RasPDU
{
} ;

Quoted 14 lines · Voicu Liviu
Quoted 9 lines · Rafael Costa dos Santos

Can anyone explain me what does < > means ?
Example:

class RegistrationRequestPDU : public RasPDU<H225_RegistrationRequest> {
} ;

Is "RegistrationRequestPDU" inheriting from RasPDU, H225_RegistrationRequest or both ?

RegistrationRequestPDU inherits from RasPDU using template H225_RegistrationRequest ?