uLib-0.2
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Array.h
Go to the documentation of this file.
1
/*//////////////////////////////////////////////////////////////////////////////
2
// CMT Cosmic Muon Tomography project //////////////////////////////////////////
4
5
Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova
6
All rights reserved
7
8
Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it >
9
10
------------------------------------------------------------------
11
This library is free software; you can redistribute it and/or
12
modify it under the terms of the GNU Lesser General Public
13
License as published by the Free Software Foundation; either
14
version 3.0 of the License, or (at your option) any later version.
15
16
This library is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
Lesser General Public License for more details.
20
21
You should have received a copy of the GNU Lesser General Public
22
License along with this library.
23
25
26
27
28
#ifndef U_CORE_ARRAY_H
29
#define U_CORE_ARRAY_H
30
31
#include <array> // std::array
32
33
#include "Types.h"
34
42
43
44
namespace uLib {
45
46
template< typename T, Size_t size >
47
class Array : public std::array<T,size> {
48
49
};
50
51
52
template< typename T, Size_t size >
53
class SmartArray : public SmartPointer< Array<T,size> > {
54
typedef SmartPointer< Array<T,size> > ptr;
55
public:
56
SmartArray() : ptr(new Array<T,size>()) { }
57
SmartArray( const SmartArray ©) : ptr(copy) { }
58
virtual ~SmartArray() {}
59
60
T& operator[](unsigned int p) {
61
return ptr::get()->at(p);
62
}
63
64
65
66
};
67
68
69
70
}
71
72
#endif // ARRAY_H
Core
Array.h
Generated by
1.8.5