-
Notifications
You must be signed in to change notification settings - Fork 0
/
CodeSnap-CompoundObjects.txt.html
137 lines (132 loc) · 4.57 KB
/
CodeSnap-CompoundObjects.txt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!----------------------------------------------------------------------------
CodeSnap-ClassAnatomy.cs.htm
Published 19 Mar 2017
Jim Fawcett, CSE687 : Object Oriented Design, Summer 2017
Note:
- Markup characters in the text part, enclosed in <pre>...</pre> have to be
replaced with escape sequences, e.g., < becomes < and > becomes >
- Be careful that you don't replace genuine markup characters with escape
sequences, e.g., everything outside of the <pre>...</pre> section.
----------------------------------------------------------------------------->
<html>
<head>
<title>CodeSnap-CompoundObjects</title>
<script src="js/ScriptsUtilities.js"></script>
<script src="js/ScriptsTemplate.js"></script>
<script src="js/ScriptsKeyboard.js"></script>
<script src="js/ScriptsMenuCpp.js"></script>
<link rel="stylesheet" href="css/StylesTemplate.css" />
<link rel="stylesheet" href="css/StylesMenu.css" />
<style>
h3 {
font-weight: normal;
}
</style>
</head>
<body id="github" onload="initializeMenu()">
<nav>
<div id="navbar"></div>
</nav>
<a id="Next" href="CodeSnap-CompoundObjects.cpp.html">N</a>
<a id="Prev" href="CodeSnap-CompoundObjects.cpp.html">P</a>
<div style="position:fixed; top:150px; right:100px; opacity:0.85; width:35%;" onclick="this.style.display = 'none'">
<img src="Pictures/ObjectRelationships.JPG" width="98%" />
<div style="width:98%; text-align:center;">click to close</div>
</div>
<navKeys-Container>
<nav-Key id="sKey" onclick="toggleSwipeEvents()">S</nav-Key>
<nav-Key id="rKey" onclick="location.reload()">R</nav-Key>
<nav-Key id="tKey" onclick="scrollPageTop()">T</nav-Key>
<nav-Key id="bKey" onclick="scrollPageBottom()">B</nav-Key>
<nav-Key id="hKey" onclick="helpWin()">H</nav-Key>
<nav-Key id="pKey" onclick="loadPrev()">P</nav-Key>
<nav-Key id="nKey" onclick="loadNext()">N</nav-Key>
</navKeys-Container>
<h3>
<a href="CodeSnap-CompoundObjects.cpp.html">CompObj.cpp</a>,
<a href="CodeSnap-CompoundObjects.txt.html">CompObj.txt</a>,
<a class="disable" href="#">Code folder</a>,
<a href="CompoundObjects.htm">Compound Objects webpage</a>,
<a href="DesignNote-CppClassRelationships.htm">Class Relationships webpage</a>
</h3>
<div class="indent">
Compound objects are objects that contain and use instances of other classes.<br />
Of particular
importance is the way they are initialized in constructor implementations.<br />
That aspect is
illustrated in this example.<br /><br />
All of the classes in this demo have correct copy, assignment, destruction, and move semantics,
so we would normally defer to the compiler generated operations. However, for this
demo we want to show how each of these methods are defined and show when they are invoked
by writing from them to the console.
<p></p>
<a href="Pictures/ObjectRelationships.JPG">UML Diagram</a> showing an abstract view of this code.
</div>
<hr />
<pre class="codeSnap">
============================================
Demonstrating Operation of Compound Object
============================================
U default construction
C default construction
B default construction
D default construction
D using U
----------------------
Running testFunction
----------------------
C default construction
B default construction
D default construction
C move construction
B move construction
D move construction
D destruction
B destruction
C destruction
D move assignment
B move assignment
C move assignment
D destruction
B destruction
C destruction
----------------------------
starting copy construction
----------------------------
C copy construction
B copy construction
D copy construction
----------------------------
starting move construction
----------------------------
C move construction
B move construction
D move construction
----------------------------
Demonstrating polymorphism
----------------------------
C default construction
B default construction
Calling B::g()
Calling D::g()
----------------------
leaving main's scope
----------------------
D destruction
B destruction
C destruction
D destruction
B destruction
C destruction
D destruction
B destruction
C destruction
U destruction
Press any key to continue . . .
</pre>
<!--<div class="photo">
<img src="pictures/CSTstrip.jpg" width="100%" />
</div>-->
<info-bar></info-bar>
</body>
</html>