diff --git a/.gitignore b/.gitignore index b042d9e..6f27771 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,307 @@ -.vscode -tikz-uml.sty -/svg-inkscape -*.synctex.gz \ No newline at end of file +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bbl-SAVE-ERROR +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync +*.rubbercache +rubber.cache + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs +*.slg +*.slo +*.sls + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplot +*.gnuplot +*.table + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.glog +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hypdoc +*.hd + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# newpax +*.newpax + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# svg +svg-inkscape/ + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# titletoc +*.ptc + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib \ No newline at end of file diff --git a/Cpp.pdf b/Cpp.pdf index 08b446c..425d41f 100644 Binary files a/Cpp.pdf and b/Cpp.pdf differ diff --git a/Cpp.tex b/Cpp.tex index 4616be0..94d803a 100644 --- a/Cpp.tex +++ b/Cpp.tex @@ -122,13 +122,13 @@ \begin{document} \begin{multicols*}{3} \raggedcolumns - \begin{minipage}{0.75\columnwidth} + \begin{minipage}[c]{0.75\columnwidth} \maketitle \end{minipage} - \begin{minipage}{0.2\columnwidth} + \begin{minipage}[c]{0.2\columnwidth} \begin{center} \quad - \qrcode[height=1cm]{https://github.com/Iceteavanill} + \qrcode[height=\linewidth]{https://github.com/Iceteavanill/Cheatsheet-Prog_Cpp_FS_2024_OST} \qquad \end{center} \end{minipage} diff --git a/README.md b/README.md index d0681b2..8774037 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,32 @@ -Zusammenfassung Vorlesung Prog Cpp +# Zusammenfassung Vorlesung Prog Cpp +## Modulinfo Frühlingssemester 2024 Dozent: Prof. Dr. Christian Werner OST Rapperswil +## Disclaimer + +Die Zusammenfassung wurde sorgfältig erstellt. Es kann allerdings keine Garantie für den Inhalt gegeben werden. + +Gefundene Fehler bitte per Issue melden. + +Um es einfacher zu machen, diese Zusammenfassung anzupassen wurden die Flags "tikzumlWorks" und "svgWorks" implementiert. Diese erlauben es die Zusammenfassung anzupassen ohne das TikzUML und SVG Package zu installieren. + +Danke an Fabian Suter und Nino Briker fürs Gegenlesen. + +[Fabian Suter](https://github.com/FabianSuter) hat diese Zusammenfassung mit ein paar Beispielen [erweitert](https://github.com/FabianSuter/ProgCpp) + +# Quellen -Die Zusammenfassung wurde zwar sorgfältig erstellt, allerdings kann keine Garantie für den Inhalt gegeben werden. Einige Inhalte wurden aus den Unterrichtsmaterialien entnommen. -Danke an Fabian Suter und Nino Briker fürs gegenlesen. -Um es einfacher zu machen diese Zusammenfassung anzupassen wurden die Flags "tikzumlWorks" und "svgWorks" implementiert. Diese erlauben es die Zusammenfassung anzupassen ohne das TikzUML und SVG package zu installieren. +## Template + +Das Template ist an der [AMIV/ETHZ Summaries Template Landscape](https://www.overleaf.com/latex/templates/amiv-slash-ethz-summaries-template-landscape/trggddjtjhqr) angelehnt. + +# Lizenz-Info -[Fabian Suter](https://github.com/FabianSuter) hat diese Zusammenfassung mit ein paar Beispielen [erweitert](https://github.com/FabianSuter/ProgCpp) \ No newline at end of file +Dieses Werk steht, sofern nicht anders angegeben, unter der [Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA) 4.0-Lizenz](https://creativecommons.org/licenses/by-sa/4.0/). \ No newline at end of file diff --git a/Sections/02_Objektorientierung.tex b/Sections/02_Objektorientierung.tex index 50228e9..dd6a8be 100644 --- a/Sections/02_Objektorientierung.tex +++ b/Sections/02_Objektorientierung.tex @@ -384,7 +384,11 @@ \subsubsection{Sichtbarkeit} Mit \textbf{private} wird alles private (nicht sehr nützlich). \begin{center} - \includegraphics[width=0.7\columnwidth]{pictures/Vererbung.png} + \ifthenelse{\boolean{svgWorks}}{ + \includesvg[width = 0.8\linewidth, inkscapelatex=false]{svg/vererbung.svg} + }{ + \includegraphics[width=0.7\columnwidth]{pictures/Vererbung.png} + } \end{center} Wird eine Vererbung private durchgeführt, sind keine Attribute oder Methoden mehr sichtbar. @@ -467,7 +471,7 @@ \subsubsection{Implementation von RTTI} Die Unterklassen zeigen wiederum auf denselben Vtable. \begin{center} - \ifthenelse{\boolean{tikzumlWorks}}{ + \ifthenelse{\boolean{svgWorks}}{ \includesvg[width = \linewidth, inkscapelatex=false]{svg/vtable.svg} }{ \includegraphics[width=\columnwidth]{pictures/vtable.png} diff --git a/Sections/03_Memorymanagement.tex b/Sections/03_Memorymanagement.tex index 2bf64aa..1f322c8 100644 --- a/Sections/03_Memorymanagement.tex +++ b/Sections/03_Memorymanagement.tex @@ -67,7 +67,11 @@ \subsection{Speicheraufbau} Der Speicheraufbau bildlich dargestellt sieht ungefähr so aus: \begin{center} + \ifthenelse{\boolean{svgWorks}}{ + \includesvg[width = \linewidth, inkscapelatex=false]{svg/memorylayout.svg} + }{ \includegraphics[width=\columnwidth]{pictures/memorylayout.png} + } \end{center} Je nach Architektur kann es auch sein, dass die hohen und tiefen Adressen anders herum sind. diff --git a/svg/memorylayout.svg b/svg/memorylayout.svg new file mode 100644 index 0000000..e4cfcf6 --- /dev/null +++ b/svg/memorylayout.svg @@ -0,0 +1,420 @@ + + + +memorylayoutAutomatisch verwalteter Speicher: lokale Variablen,Aufrufparameter, Return-ValuesDiese beiden Bereichewachsen/schrumpfenzur laufzeit!Manuell verwalteter (dynamischer) SpeicherGlobale und statische Variablenohne explizite Initialisierung oder mit Null-InitialisierungKonstanten und ungleich-0-unitialisierte globale bzw. statische VariablenMaschinencodehigh addresslow addressStackheapunitializeddatainitializeddatatextcommand-line argumentsand environment variablesinitialized to zeroread fromprogram filememorylayout diff --git a/svg/vererbung.svg b/svg/vererbung.svg new file mode 100644 index 0000000..7942263 --- /dev/null +++ b/svg/vererbung.svg @@ -0,0 +1,506 @@ + + + +VererbungVererbungssichtbarkeitpublic (Normalfall)protectedprivateSichtbarkeit innerhalbder OberklasseSichtbarkeit innerhalbder Unterklassepublicprotectedprivatepublicprotectedprivatepublicprotectedprivatepublicprotectednicht sichtbarpublicprotectednicht sichtbarpublicprotectednicht sichtbarVererbung