4 #ifndef tools_rroot_stl_vector
5 #define tools_rroot_stl_vector
19 static const std::string& s_store_class() {
20 static const std::string s_v(
"vector<"+
stype(T())+
">");
25 static const std::string s_v(
"tools::rroot::stl_vector<"+
stype(T())+
">");
29 virtual void*
cast(
const std::string& a_class)
const {
42 std::vector<T>::clear();
52 if(!a_buffer.
read(num))
return false;
62 std::vector<T>::resize(num);
64 for(
unsigned int index=0;index<num;index++,pos++) {
65 std::vector<T>::operator[](index) = *pos;
75 mem::increment(
s_class().c_str());
80 mem::decrement(
s_class().c_str());
86 ,std::vector<T>(a_from)
89 mem::increment(
s_class().c_str());
93 std::vector<T>::operator=(a_from);
101 ,
public std::vector< std::vector<T> >
103 static const std::string& s_store_class() {
104 static const std::string s_v(
"vector<vector<"+
stype(T())+
"> >");
109 static const std::string s_v
110 (
"tools::rroot::stl_vector_vector<"+
stype(T())+
">");
114 virtual void*
cast(
const std::string& a_class)
const {
127 typedef typename std::vector<T> vec_t;
128 std::vector<vec_t>::clear();
137 if(!a_buffer.
read(vecn))
return false;
139 std::vector<vec_t>::resize(vecn);
141 for(
unsigned int veci=0;veci<vecn;veci++) {
142 vec_t& elem = std::vector<vec_t>::operator[](veci);
145 if(!a_buffer.
read(num)) {
146 std::vector<vec_t>::clear();
154 std::vector<vec_t>::clear();
159 for(
unsigned int index=0;index<num;index++,pos++) elem[index] = *pos;
169 mem::increment(
s_class().c_str());
174 mem::decrement(
s_class().c_str());
180 ,std::vector< std::vector<T> >(a_from)
183 mem::increment(
s_class().c_str());
187 std::vector< std::vector<T> >::operator=(a_from);
193 static const std::string& s_store_class() {
194 static const std::string s_v(
"vector<string>");
199 static const std::string s_v(
"tools::rroot::stl_vector_string");
203 virtual void*
cast(
const std::string& a_class)
const {
204 if(
void* p = cmp_cast<stl_vector_string>(
this,a_class))
return p;
211 if(
void* p = cmp_cast<stl_vector_string>(
this,a_class)) {
return p;}
216 std::vector<std::string>::clear();
229 if(!a_buffer.
read(num))
return false;
233 std::vector<std::string>::resize(num);
234 for(
unsigned int index=0;index<num;index++) {
235 std::string& vs = std::vector<std::string>::operator[](index);
236 if(!a_buffer.
read(vs)) {
237 std::vector<std::string>::clear();
249 mem::increment(
s_class().c_str());
254 mem::decrement(
s_class().c_str());
260 ,std::vector<std::string>(a_from)
263 mem::increment(
s_class().c_str());
267 std::vector<std::string>::operator=(a_from);