20std::map<const void*, abst_view*>& ref_view_map()
22 static std::map<const void*, abst_view*> view_map;
44 std::map<const void*, abst_view*>& vm = ref_view_map();
45 if (vm.find(ptr) == vm.end()) {
50 next_in_list = v->next_in_list;
52 v->next_in_list =
this;
54 next_in_list->prev_in_list =
this;
62 std::map<const void*, abst_view*>& vm = ref_view_map();
63 if (vm.find(ptr) == vm.end())
65 if (vm[ptr] ==
this) {
66 if (next_in_list == 0)
69 vm[ptr] = next_in_list;
70 next_in_list->prev_in_list = 0;
74 if (prev_in_list == 0) {
75 if (next_in_list == 0)
77 std::cerr <<
"ups, abst_view::detach_from_reference called for view that is not representative and has no previous element in list" << std::endl;
81 prev_in_list->next_in_list = next_in_list;
83 next_in_list->prev_in_list = prev_in_list;
86 next_in_list = prev_in_list = 0;
90void update_views(
void* member_ptr)
92 std::map<const void*, abst_view*>& vm = ref_view_map();
93 if (vm.find(member_ptr) != vm.end()) {
virtual void update()
this virtual update allows for example to ask a view to update the viewed value. The default implemen...
virtual bool controls(const void *ptr) const =0
return whether the control controls the value pointed to by ptr
bool shows(const void *ptr) const
add default implementation passing the query to the controls() method
abst_control(const std::string &name)
construct from name
type independent &base class of all views
void detach_from_reference()
detach view again
abst_view(const std::string &name)
pass name on to node, careful the implementation of this is in the source file control....
void update_views()
calls the update method of all other attached views
void attach_to_reference(const void *ptr)
links all views to a reference into a doubly linked list in order to allow controls of the reference ...
~abst_view()
ensures detachment of view