FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Prototype_pattern_exercise/Array.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
/
Array.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (37 loc) · 1.42 KB
Breadcrumbs
Prototype_pattern_exercise
/
Array.hpp
Copy path
File metadata and controls
45 lines (37 loc) · 1.42 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
//
Array.hpp
//
//
Array class. It uses an ArrayStructure for the actual storage.
//
This class acts like a kind of adapter class since it defines a common
//
interface for different array structures like normal arrays and
//
sparse arrays. The array structure to use is given as template argument.
//
//
(C) Datasim Component Technology 1999-2006
#
ifndef
Array_hpp
#
define
Array_hpp
#
include
"
ArrayStructure.hpp
"
#
include
"
FullArray.cpp
"
//
Default structure is FullArray with default allocator. Default integral type is int.
template
<
class
V
,
class
I
=
int
,
class
S
=FullArray<V> >
class
Array
{
private:
S m_structure;
//
The array structure
I m_start;
//
The start index
public:
//
Constructors & destructor
Array
();
//
Default constructor
Array
(I size);
//
Constructor with size. Start index=1.
Array
(I size, I start);
//
Constructor with size & start index
Array
(I size, I start,
const
V& value);
//
Size, start and value
Array
(
const
Array<V, I, S>& source);
//
Copy constructor
virtual
~Array
();
//
Destructor
//
Selectors
I
MinIndex
()
const
;
//
Return the minimum index
I
MaxIndex
()
const
;
//
Return the maximum index
I
Size
()
const
;
//
The size of the array
//
Operators
virtual
V&
operator
[] (I index);
//
Subscripting operator
virtual
const
V&
operator
[] (I index)
const
;
//
Subscripting operator
Array<V, I, S>&
operator
= (
const
Array<V, I, S>& source);
};
#
endif
//
Array_hpp
Back
|
FazBrowse Home
|
New Git URL