C++ class inheritance
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]
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_RegistrationRequestor 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
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_RegistrationRequestor both ?RegistrationRequestPDU inherits from RasPDU using template
H225_RegistrationRequest?
Signature · 2 lines
Rafael Costa dos Santos [email protected]
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_RegistrationRequestor both ?RegistrationRequestPDU inherits from RasPDU using template
H225_RegistrationRequest?