FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Prototype_pattern_exercise/ArrayStructure.hpp 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.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (30 loc) · 1.16 KB
Breadcrumbs
Prototype_pattern_exercise
/
ArrayStructure.hpp
Copy path
File metadata and controls
39 lines (30 loc) · 1.16 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
//
ArrayStructure.hpp
//
//
Base class for array storage structure.
//
A size_t is used for indexing. Indexing starts at 1 in this class and its
//
dervived classes. These derived classes must implement the indexing [] operator.
//
//
(C) Datasim Component Technology 1999
#
ifndef
ArrayStructure_hpp
#
define
ArrayStructure_hpp
template
<
class
V
>
class
ArrayStructure
{
public:
//
Constructors & destructor
ArrayStructure
();
//
Default constructor
ArrayStructure
(
const
ArrayStructure<V>& source);
//
Copy constructor
virtual
~ArrayStructure
();
//
Destructor
//
Selectors
virtual
size_t
Size
()
const
=0;
//
Size of the array
const
V&
Element
(
size_t
index)
const
;
//
Get element at position
size_t
MinIndex
()
const
;
//
Return the minimum index == 1
size_t
MaxIndex
()
const
;
//
Return the maximum index == size
//
Modifiers
void
Element
(
size_t
index,
const
V& val);
//
Change element at position
//
Operators
virtual
V&
operator
[] (
size_t
index) =
0
;
virtual
const
V&
operator
[] (
size_t
index)
const
=
0
;
ArrayStructure<V>&
operator
= (
const
ArrayStructure<V>& source);
};
#
endif
//
ArrayStructure_hpp
Back
|
FazBrowse Home
|
New Git URL