Skip to content

Commit ae02272

Browse files
committed
More details
1 parent a660b43 commit ae02272

File tree

2 files changed

+209
-1
lines changed

2 files changed

+209
-1
lines changed

sources/modules/compilation-model/translation-units.md

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,108 @@
33
_Skeleton descriptions are typeset in italic text,_
44
_so please don't remove these descriptions when editing the topic._
55

6-
This topic is currently under construction and will soon be filled with information :)
6+
### Overview
7+
8+
_Provides a short natural language abstract of the module’s contents._
9+
_Specifies the different levels of teaching._
10+
11+
------------------------------------------------------------------------
12+
Level Objective
13+
----------------- ------------------------------------------------------
14+
Foundational
15+
16+
Main ---
17+
18+
Advanced ---
19+
20+
------------------------------------------------------------------------
21+
22+
### Motivation
23+
24+
_Why is this important?_
25+
_Why do we want to learn/teach this topic?_
26+
27+
### Topic introduction
28+
29+
_Very brief introduction to the topic._
30+
31+
_TODO:
32+
_introduce notion of object file
33+
34+
C++ Compilation model allows the developer to seperate their
35+
declarations and definitions into various files so as to:
36+
37+
* organize code logically,
38+
* facilitate reuse,
39+
* reduce rebuild times,
40+
* reduce file sizes and scopes,
41+
* avoid naming collisions,
42+
* and produce compiled libraries.
43+
44+
45+
### Foundational: Building code from multiple files
46+
47+
#### Background/Required Knowledge
48+
49+
A student:
50+
51+
1. Is able to define a variable, function, or class
52+
2. Is able to access declarations from either module import or header inclusion
53+
54+
Questions:
55+
modules and/or functions?
56+
57+
58+
#### Student outcomes
59+
60+
_A list of things "a student should be able to" after the curriculum._
61+
_The next word should be an action word and testable in an exam._
62+
_Max 5 items._
63+
64+
A student should be able to:
65+
66+
1. create a declaration for variables, functions, and classes separate from their definitions
67+
2. compile and link code from multiple implementation files
68+
3. explain how includes or imports work within their translation unit
69+
70+
#### Caveats
71+
72+
_This section mentions subtle points to understand, like anything resulting in
73+
implementation-defined, unspecified, or undefined behavior._
74+
75+
#### Points to cover
76+
77+
_This section lists important details for each point._
78+
79+
Declarations and definitions can be within same file
80+
81+
### Main: Organizing code across multiple translation units
82+
83+
#### Background/Required Knowledge
84+
85+
* All of the above.
86+
87+
#### Student outcomes
88+
89+
A student should be able to:
90+
91+
1. package code into libraries
92+
2. explain trade-offs for placing code in header files vs implementation files
93+
94+
#### Caveats
95+
96+
#### Points to cover
97+
98+
### Advanced
99+
100+
_These are important topics that are not expected to be covered but provide
101+
guidance where one can continue to investigate this topic in more depth._
102+
103+
A student should be able to:
104+
105+
1. explain how an anonymous namespace functions within their translation unit
106+
2. One-definition-rule shennanigans
107+
3. Pimpl pattern
108+
4. Template definitions in translation unit it's used in?
109+
110+
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
## External libraries: Desktop Graphical User Interfaces {#extern-gui}
2+
3+
_Skeleton descriptions are typeset in italic text,_
4+
_so please don't remove these descriptions when editing the topic._
5+
6+
### Overview
7+
8+
_Provides a short natural language abstract of the module’s contents._
9+
_Specifies the different levels of teaching._
10+
11+
------------------------------------------------------------------------
12+
Level Objective
13+
----------------- ------------------------------------------------------
14+
Foundational: Basic use of separate compilation
15+
16+
Main: Command of supporting mechanisms and tools
17+
18+
Advanced: Technicalities and tools
19+
20+
------------------------------------------------------------------------
21+
22+
### Motivation
23+
24+
_Why is this important?_
25+
_Why do we want to learn/teach this topic?_
26+
27+
For some applications a graphical user interface is beneficial. However, graphical user inerfaces are not part of the C++ standard and external libaries are needed. We provide generic teaching goals and do not focus on a specific external library. Some mentionable libraries are: [Qt](https://www.qt.io/), [Cairo](https://www.cairographics.org/), and [wxWidgets](https://www.wxwidgets.org/).
28+
29+
### Topic introduction
30+
31+
_Very brief introduction to the topic._
32+
33+
### Foundational: Basic use of separate compilation
34+
35+
#### Background/Required Knowledge
36+
37+
A student:
38+
39+
1. should know linking libraries
40+
2. should know [header files](../compilation-model/headers.md)
41+
3. should know about [build systems](../compilation-model/buildsystems.md)
42+
43+
#### Student outcomes
44+
45+
_A list of things "a student should be able to" after the curriculum._
46+
_The next word should be an action word and testable in an exam._
47+
_Max 5 items._
48+
49+
A student should be able to:
50+
51+
1. link against the external library
52+
2. write an application with one window
53+
3. add simple widgets like text boxes and buttons to the window
54+
4. catch events of buttons or other elements
55+
5. explain the mechanicsm of event-driven programming
56+
57+
#### Points to cover
58+
59+
* use basic API functions
60+
* layout of the window
61+
* handle events by callbacks
62+
63+
#### Caveats
64+
65+
_This section mentions subtle points to understand, like anything resulting in
66+
implementation-defined, unspecified, or undefined behavior._
67+
68+
* programming user interfaces in C++ and in general require plenty of boiler plate code
69+
* API calls are specific to one library and might not be transferable to other libraries
70+
* Some libraries are written in C
71+
72+
### Main: Command of supporting mechanisms and tools
73+
74+
#### Background/Required Knowledge
75+
76+
* All of the above.
77+
78+
#### Student outcomes
79+
80+
A student should be able to:
81+
82+
1. add more advanced elements, like tables or images
83+
2. handle multiple windows
84+
3. show error and warning popups
85+
4. use different forms of IO, like keyboard, mouse, or touchpad
86+
5. explain basic of fonts and accesibilty
87+
88+
#### Caveats
89+
90+
* programming user interfaces is rather complex and might not applicable for most students
91+
92+
#### Points to cover
93+
94+
* More advanced API calls and design patterns
95+
96+
### Advanced: Technicalities and tools
97+
98+
_These are important topics that are not expected to be covered but provide
99+
guidance where one can continue to investigate this topic in more depth._
100+
101+
* Internationalization
102+
* Font desginers
103+
* Hardware accleration
104+
* Custom widget generation

0 commit comments

Comments
 (0)