FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Prototype_pattern_exercise/ArrayStructure.cpp at master · cablegui/Prototype_pattern_exercise · GitHub
cablegui
/
Prototype_pattern_exercise
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Prototype_pattern_exercise
/
ArrayStructure.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
75 lines (56 loc) · 1.41 KB
Breadcrumbs
Prototype_pattern_exercise
/
ArrayStructure.cpp
Copy path
File metadata and controls
75 lines (56 loc) · 1.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
//
ArrayStructure.cpp
//
//
Base class for Array storage structure.
//
A size_t is used for indexing. Indexing starts at 0.
//
//
28 january 1999 RD Started
//
2002-4-8 DD small changes
//
//
(C) Datasim Component Technology 1999
#
ifndef
ArrayStructure_cpp
#
define
ArrayStructure_cpp
#
include
"
ArrayStructure.hpp
"
//
Constructors & destructor
template
<
class
V
>
ArrayStructure<V>::ArrayStructure()
{
//
Default constructor
}
template
<
class
V
>
ArrayStructure<V>::ArrayStructure(
const
ArrayStructure<V>& source)
{
//
Copy constructor
}
template
<
class
V
>
ArrayStructure<V>::
~ArrayStructure
()
{
//
Destructor
}
//
Selectors
template
<
class
V
>
inline
const
V& ArrayStructure<V>::Element(
size_t
index)
const
{
//
Get element at position
//
Use the subscript operator in derived classes
return
((*
this
)[index]);
}
template
<
class
V
>
size_t
ArrayStructure<V>::MinIndex()
const
{
//
Return the minimum index
//
Always ONE
return
1
;
}
template
<
class
V
>
size_t
ArrayStructure<V>::MaxIndex()
const
{
//
Return the maximum index
return
Size
();
}
//
Modifiers
template
<
class
V
>
inline
void
ArrayStructure<V>::Element(
size_t
index,
const
V& val)
{
//
Change element at position
//
Use the subscript operator in derived classes
(*
this
)[index]=val;
}
template
<
class
V
>
ArrayStructure<V>& ArrayStructure<V>::
operator
= (
const
ArrayStructure<V>& source)
{
//
Assignment operator
return
*
this
;
}
#
endif
//
ArrayStructure_cpp
Back
|
FazBrowse Home
|
New Git URL