Last change
on this file since 520 was
520,
checked in by pooh, 18 years ago
|
- Added vector implementation.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
623 bytes
|
Line | |
---|
1 | #ifndef __pxx_vector_hh__ |
---|
2 | #define __pxx_vector_hh__ |
---|
3 | |
---|
4 | #include "pxx_common.hh" |
---|
5 | #include "pxx_exception.hh" |
---|
6 | |
---|
7 | namespace pxx |
---|
8 | { |
---|
9 | |
---|
10 | template <typename type_t> |
---|
11 | class Vector |
---|
12 | { |
---|
13 | |
---|
14 | private: |
---|
15 | |
---|
16 | type_t* data ; |
---|
17 | size_t length ; |
---|
18 | size_t capacity ; |
---|
19 | |
---|
20 | public: |
---|
21 | |
---|
22 | Vector (size_t _length = 0) ; |
---|
23 | Vector (Vector const& _s) ; |
---|
24 | ~Vector () ; |
---|
25 | Vector& operator = (Vector const& _s) ; |
---|
26 | |
---|
27 | type_t const* get_data () const ; |
---|
28 | |
---|
29 | void expand (size_t _extra) ; |
---|
30 | type_t const& operator [] (size_t _index) const ; |
---|
31 | type_t& operator [] (size_t _index) ; |
---|
32 | size_t get_length () const ; |
---|
33 | size_t get_capacity () const ; |
---|
34 | |
---|
35 | }; |
---|
36 | |
---|
37 | } |
---|
38 | |
---|
39 | #endif // __pxx_vector_hh__ |
---|
Note: See
TracBrowser
for help on using the repository browser.