MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
AbstractGels.h
1 /********************************************************************/
2 /* Copyright (c) 2015 DG Technologies Inc. and Yuzi Mizuno */
3 /* All rights reserved. */
4 /********************************************************************/
5 #ifndef _MGAbstractGells_HH_
6 #define _MGAbstractGells_HH_
7 
8 #include <vector>
9 #include <iosfwd>
10 #include "mg/MGCL.h"
11 #include "mg/types.h"
12 
18 //
19 //Define MGAbstractGels Class.
20 
22 
25 class MG_DLL_DECLR MGAbstractGels{
26  typedef std::vector<MGAbstractGel> container_type;
27 public:
28 // 別名定義
29  typedef container_type::reference reference;
30  typedef container_type::const_reference const_reference;
31  typedef container_type::iterator iterator;
32  typedef container_type::const_iterator const_iterator;
33  typedef container_type::size_type size_type;
34  typedef container_type::difference_type difference_type;
35  typedef container_type::value_type value_type;
36  typedef container_type::allocator_type allocator_type;
37  typedef allocator_type::pointer pointer;
38  typedef allocator_type::const_pointer const_pointer;
39  typedef container_type::reverse_iterator reverse_iterator;
40  typedef container_type::const_reverse_iterator const_reverse_iterator;
41 
43 MG_DLL_DECLR friend std::ostream& operator<< (std::ostream&, const MGAbstractGels&);
44 
46 
49 
51 MGAbstractGels(const MGAbstractGel& agell);
52 
53 //Copy constructor.
54 //MGAbstractGels(const MGAbstractGels& obj2);
55 
56 //Destructor
57 //~MGAbstractGels();
58 
60 
62 const_reference operator[](size_type i)const{return m_agells[i];};
63 reference operator[](size_type i){return m_agells[i];};
64 
65 // //////Member Function////////
66 
69 const_reference back() const{return m_agells.back();};
70 reference back(){return m_agells.back();};
71 
73 const_iterator begin() const{return m_agells.begin();}
74 iterator begin(){return m_agells.begin();}
75 
77 void clear(){m_agells.clear();};
78 
81 bool empty() const{return m_agells.empty();};
82 
84 const_iterator end() const{return m_agells.end();};
85 iterator end(){return m_agells.end();};
86 
89 iterator erase(iterator x){return m_agells.erase(x);};
90 
93 iterator erase(iterator first, iterator last){return m_agells.erase(first,last);};
94 
97 const_reference front() const{return m_agells.front();};
98 reference front(){return m_agells.front();};
99 
102 iterator insert(iterator it, const MGAbstractGel& x){return m_agells.insert(it,x);};
103 
105 void pop_back(){m_agells.pop_back();};
106 
108 void push_back(const MGAbstractGel& x){m_agells.push_back(x);};
109 
111 void push_back(const MGAbstractGels& agells){
112  m_agells.insert(end(), agells.begin(), agells.end());
113 }
114 
116 const_reverse_iterator rbegin() const{return m_agells.rbegin();};
117 reverse_iterator rbegin(){return m_agells.rbegin();};
118 
120 const_reverse_iterator rend() const{return m_agells.rend();};
121 reverse_iterator rend(){return m_agells.rend();};
122 
124 void resize(size_type n){m_agells.resize(n);};
125 
127 size_type size() const{return m_agells.size();};
128 
129 private:
131  container_type m_agells;
132 
133 
134 };
135  // end of GelRelated group
137 #endif
container_type::reference reference
Definition: AbstractGels.h:29
void push_back(const MGAbstractGels &agells)
push elements in agells at the end of this.
Definition: AbstractGels.h:111
iterator end()
Definition: AbstractGels.h:85
void pop_back()
pop last element.
Definition: AbstractGels.h:105
iterator insert(iterator it, const MGAbstractGel &x)
Definition: AbstractGels.h:102
MGAbstractGels()
Void constructor(初期化なしでオブジェクトを作成する。)
Definition: AbstractGels.h:48
reverse_iterator rbegin()
Definition: AbstractGels.h:117
void resize(size_type n)
Resize the agells.
Definition: AbstractGels.h:124
container_type::allocator_type allocator_type
Definition: AbstractGels.h:36
size_type size() const
Return the number of items that are in the vector.
Definition: AbstractGels.h:127
const_reference operator[](size_type i) const
Refer to i-th MGAbstractGel.
Definition: AbstractGels.h:62
reverse_iterator rend()
Definition: AbstractGels.h:121
Is a container of MGAbstractGel, to specify what kind of gels are required.
Definition: AbstractGels.h:25
allocator_type::pointer pointer
Definition: AbstractGels.h:37
std::ostream & operator<<(std::ostream &ostrm, const MGisect &is)
Debug Function.
Definition: isect.h:95
container_type::value_type value_type
Definition: AbstractGels.h:35
void clear()
clear list, that is, erase all the elements in the MGAbstractGels.
Definition: AbstractGels.h:77
const_reference back() const
Definition: AbstractGels.h:69
container_type::const_reverse_iterator const_reverse_iterator
Definition: AbstractGels.h:40
const_iterator begin() const
Return iterator at the beginning of list.
Definition: AbstractGels.h:73
iterator erase(iterator x)
Definition: AbstractGels.h:89
container_type::iterator iterator
Definition: AbstractGels.h:31
reference operator[](size_type i)
Definition: AbstractGels.h:63
const_reference front() const
Definition: AbstractGels.h:97
const_reverse_iterator rbegin() const
Return reverse_iterator at the beginning of list.
Definition: AbstractGels.h:116
iterator erase(iterator first, iterator last)
Definition: AbstractGels.h:93
reference front()
Definition: AbstractGels.h:98
container_type::const_reference const_reference
Definition: AbstractGels.h:30
reference back()
Definition: AbstractGels.h:70
container_type::difference_type difference_type
Definition: AbstractGels.h:34
container_type::size_type size_type
Definition: AbstractGels.h:33
const_reverse_iterator rend() const
Return const_reverse_iterator at the end of list.
Definition: AbstractGels.h:120
const_iterator end() const
Return const_iterator at the end of MGAbstractGels.
Definition: AbstractGels.h:84
container_type::const_iterator const_iterator
Definition: AbstractGels.h:32
allocator_type::const_pointer const_pointer
Definition: AbstractGels.h:38
bool empty() const
Definition: AbstractGels.h:81
void push_back(const MGAbstractGel &x)
push element x at the end.
Definition: AbstractGels.h:108
iterator begin()
Definition: AbstractGels.h:74
container_type::reverse_iterator reverse_iterator
Definition: AbstractGels.h:39