musrsim/geant4/TaoLEMuSR/doc/node13.html
2008-03-20 09:23:20 +00:00

67 lines
2.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with jLaTeX2HTML 2002-2-1 (1.70) JA patch-2.0
patched version by: Kenshi Muto, Debian Project.
* modified by: Shige TAKENO
LaTeX2HTML 2002-2-1 (1.70),
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>A bit more about user classes: the inheritance philosophy</TITLE>
<META NAME="description" CONTENT="A bit more about user classes: the inheritance philosophy">
<META NAME="keywords" CONTENT="LEMuSR_Simulation">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="jLaTeX2HTML v2002-2-1 JA patch-2.0">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="LEMuSR_Simulation.css">
<LINK REL="previous" HREF="node12.html">
<LINK REL="up" HREF="node11.html">
<LINK REL="next" HREF="node14.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html193"
HREF="node14.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="file:/usr/share/latex2html/icons/next.png"></A>
<A NAME="tex2html191"
HREF="node11.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="file:/usr/share/latex2html/icons/up.png"></A>
<A NAME="tex2html187"
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="file:/usr/share/latex2html/icons/prev.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html194"
HREF="node14.html">Installation of the LEMuSR</A>
<B> Up:</B> <A NAME="tex2html192"
HREF="node11.html">Usefull C++ notions</A>
<B> Previous:</B> <A NAME="tex2html188"
HREF="node12.html">Header files and source</A>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00132000000000000000">
A bit more about user classes: the inheritance philosophy</A>
</H2>
A base class (a class from which other class derive) can present so-called <I>virtual</I> methods. That means that these methods can be re-written in a daughter class definition: in C++ language, virtual methods can be overloaded. Virtual methods are the key of Geant4 framework modularity: a large amount of Geant4 classes can be personalized by the user. The latter just has to rewrite the virtual methods, making sure to keep their exact name because they might be called at other places of the framework. As an example, the method in charge of builing the geometry must be called <I>Construct()</I>, and the messengers' method in charge of modifying parameters must have the name <I>SetNewValue()</I>.
<P>
<BR><HR>
<ADDRESS>
2005-12-21
</ADDRESS>
</BODY>
</HTML>