Update of /cvsroot/pure-data/externals/grh/PDContainer/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15120/src
Modified Files:
h_deque.cpp h_list.cpp h_vector.cpp h_set.cpp h_multiset.cpp
h_map.cpp h_multimap.cpp
Log Message:
additional methods: [getall(, [keys(, [values(
Index: h_multiset.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_multiset.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_multiset.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_multiset.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 83,86 ****
--- 83,110 ----
}
+ static void h_multiset_getall(t_h_multiset *x)
+ {
+ multiset<Element>::iterator iter = x->hmultiset->getAll().begin();
+
+ while(iter != x->hmultiset->getAll().end())
+ {
+ Element output = *iter;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_multiset_print(t_h_multiset *x)
{
***************
*** 201,204 ****
--- 225,230 ----
class_addmethod(h_multiset_class, (t_method)h_multiset_get_namespace,
gensym("getnamespace"), A_DEFFLOAT, 0);
+ class_addmethod(h_multiset_class, (t_method)h_multiset_getall,
+ gensym("getall"), A_DEFFLOAT, 0);
class_addmethod(h_multiset_class, (t_method)h_multiset_print,
gensym("print"), A_DEFFLOAT, 0);
Index: h_multimap.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_multimap.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_multimap.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_multimap.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 180,183 ****
--- 180,231 ----
}
+ static void h_multimap_keys(t_h_multimap *x)
+ {
+ multimap<Element,Element>::iterator iter = x->hmultimap->getAll().begin();
+
+ while(iter != x->hmultimap->getAll().end())
+ {
+ Element output = (*iter).first;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
+ static void h_multimap_values(t_h_multimap *x)
+ {
+ multimap<Element,Element>::iterator iter = x->hmultimap->getAll().begin();
+
+ while(iter != x->hmultimap->getAll().end())
+ {
+ Element output = (*iter).second;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_multimap_print(t_h_multimap *x)
{
***************
*** 311,314 ****
--- 359,366 ----
class_addmethod(h_multimap_class, (t_method)h_multimap_get_namespace,
gensym("getnamespace"), A_DEFFLOAT, 0);
+ class_addmethod(h_multimap_class, (t_method)h_multimap_keys,
+ gensym("keys"), A_DEFFLOAT, 0);
+ class_addmethod(h_multimap_class, (t_method)h_multimap_values,
+ gensym("values"), A_DEFFLOAT, 0);
class_addmethod(h_multimap_class, (t_method)h_multimap_print,
gensym("print"), A_DEFFLOAT, 0);
Index: h_deque.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_deque.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_deque.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_deque.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 344,347 ****
--- 344,371 ----
}
+ static void h_deque_getall(t_h_deque *x)
+ {
+ deque<Element>::iterator iter = x->hdeque->getAll().begin();
+
+ while(iter != x->hdeque->getAll().end())
+ {
+ Element output = *iter;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_deque_print(t_h_deque *x)
{
***************
*** 555,558 ****
--- 579,584 ----
class_addmethod(h_deque_class, (t_method)h_deque_get_namespace,
gensym("getnamespace"), A_DEFFLOAT, 0);
+ class_addmethod(h_deque_class, (t_method)h_deque_getall,
+ gensym("getall"), A_DEFFLOAT, 0);
class_addmethod(h_deque_class, (t_method)h_deque_print,
gensym("print"), A_DEFFLOAT, 0);
Index: h_vector.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_vector.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_vector.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_vector.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 262,265 ****
--- 262,289 ----
}
+ static void h_vector_getall(t_h_vector *x)
+ {
+ vector<Element>::iterator iter = x->hvector->getAll().begin();
+
+ while(iter != x->hvector->getAll().end())
+ {
+ Element output = *iter;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_vector_print(t_h_vector *x)
{
***************
*** 466,469 ****
--- 490,495 ----
gensym("getnamespace"), A_DEFFLOAT, 0);
class_addmethod(h_vector_class, (t_method)h_vector_print,
+ gensym("getall"), A_DEFFLOAT, 0);
+ class_addmethod(h_vector_class, (t_method)h_vector_print,
gensym("print"), A_DEFFLOAT, 0);
class_addmethod(h_vector_class, (t_method)h_vector_clear,
Index: h_list.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_list.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_list.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_list.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 280,283 ****
--- 280,307 ----
}
+ static void h_list_getall(t_h_list *x)
+ {
+ list<Element>::iterator iter = x->hlist->getAll().begin();
+
+ while(iter != x->hlist->getAll().end())
+ {
+ Element output = *iter;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_list_print(t_h_list *x)
{
***************
*** 427,430 ****
--- 451,456 ----
class_addmethod(h_list_class, (t_method)h_list_clear_all,
gensym("clearall"), A_DEFFLOAT, 0);
+ class_addmethod(h_list_class, (t_method)h_list_getall,
+ gensym("getall"), A_DEFFLOAT, 0);
class_addmethod(h_list_class, (t_method)h_list_print,
gensym("print"), A_DEFFLOAT, 0);
Index: h_map.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_map.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_map.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_map.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 183,186 ****
--- 183,234 ----
}
+ static void h_map_keys(t_h_map *x)
+ {
+ map<Element,Element>::iterator iter = x->hmap->getAll().begin();
+
+ while(iter != x->hmap->getAll().end())
+ {
+ Element output = (*iter).first;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
+ static void h_map_values(t_h_map *x)
+ {
+ map<Element,Element>::iterator iter = x->hmap->getAll().begin();
+
+ while(iter != x->hmap->getAll().end())
+ {
+ Element output = (*iter).second;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_map_print(t_h_map *x)
{
***************
*** 315,318 ****
--- 363,370 ----
class_addmethod(h_map_class, (t_method)h_map_get_namespace,
gensym("getnamespace"), A_DEFFLOAT, 0);
+ class_addmethod(h_map_class, (t_method)h_map_keys,
+ gensym("keys"), A_DEFFLOAT, 0);
+ class_addmethod(h_map_class, (t_method)h_map_values,
+ gensym("values"), A_DEFFLOAT, 0);
class_addmethod(h_map_class, (t_method)h_map_print,
gensym("print"), A_DEFFLOAT, 0);
Index: h_set.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grh/PDContainer/src/h_set.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** h_set.cpp 21 Oct 2005 11:56:32 -0000 1.1
--- h_set.cpp 3 Nov 2005 20:40:40 -0000 1.2
***************
*** 83,86 ****
--- 83,110 ----
}
+ static void h_set_getall(t_h_set *x)
+ {
+ set<Element>::iterator iter = x->hset->getAll().begin();
+
+ while(iter != x->hset->getAll().end())
+ {
+ Element output = *iter;
+
+ if(output.getLength() == 1) // symbol or float
+ {
+ if (output.getAtom()[0].a_type == A_FLOAT)
+ outlet_float(x->out0, output.getAtom()[0].a_w.w_float);
+ if (output.getAtom()[0].a_type == A_SYMBOL)
+ outlet_symbol(x->out0, output.getAtom()[0].a_w.w_symbol);
+ if (output.getAtom()[0].a_type == A_POINTER)
+ outlet_pointer(x->out0, output.getAtom()[0].a_w.w_gpointer);
+ }
+ if(output.getLength() > 1) // list
+ outlet_list(x->out0,&s_list,output.getLength(),output.getAtom());
+
+ iter++;
+ }
+ }
+
static void h_set_print(t_h_set *x)
{
***************
*** 201,204 ****
--- 225,230 ----
class_addmethod(h_set_class, (t_method)h_set_get_namespace,
gensym("getnamespace"), A_DEFFLOAT, 0);
+ class_addmethod(h_set_class, (t_method)h_set_getall,
+ gensym("getall"), A_DEFFLOAT, 0);
class_addmethod(h_set_class, (t_method)h_set_print,
gensym("print"), A_DEFFLOAT, 0);