G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsStdVectorRef.h
Go to the documentation of this file.
1
14#pragma once
15
16namespace gismo
17{
18
26template<class obj>
28{
29public:
30
32 inline gsStdVectorRef(const std::vector<obj> & refVec) :
33 m_ref(refVec)
34 { }
35
36
38 inline const obj & operator[](size_t i) const
39 { return m_ref[i]; }
40
42 inline operator const std::vector<obj> & () const
43 { return m_ref; }
44
46 inline operator const obj &() const
47 { return m_ref.front(); }
48
50 inline const obj & front() const
51 { return m_ref.front(); }
52
54 inline const obj & back () const
55 { return m_ref.back(); }
56
58 inline size_t size () const
59 { return m_ref.size(); }
60
61private:
62 const std::vector<obj> & m_ref;
63
64private:
67};
68
69
70} // namespace gismo
Simple wrapper class for a vector of objects.
Definition gsStdVectorRef.h:28
gsStdVectorRef(const std::vector< obj > &refVec)
Constructor from a vector of objs.
Definition gsStdVectorRef.h:32
size_t size() const
Size.
Definition gsStdVectorRef.h:58
const obj & operator[](size_t i) const
Accessor.
Definition gsStdVectorRef.h:38
const obj & front() const
Front.
Definition gsStdVectorRef.h:50
const obj & back() const
Back.
Definition gsStdVectorRef.h:54
The G+Smo namespace, containing all definitions for the library.