43 #define BINDER_CK(prm) DBG_CK(prm) 55 return binder::CL_NAME;
74 return ((bn_left ==
this) && (bn_right ==
this));
79 bn_left->bn_right = bn_right;
80 bn_right->bn_left = bn_left;
86 BINDER_CK(bn_right->bn_left ==
this);
87 BINDER_CK(bn_left->bn_right ==
this);
91 void bind_to_my_right(binder& the_rgt){
92 BINDER_CK(the_rgt.is_alone());
93 BINDER_CK(ck_binder());
95 the_rgt.bn_right = bn_right;
96 the_rgt.bn_left =
this;
97 bn_right->bn_left = &the_rgt;
100 BINDER_CK(the_rgt.ck_binder());
101 BINDER_CK(ck_binder());
104 void bind_to_my_left(binder& the_lft){
105 BINDER_CK(the_lft.is_alone());
106 BINDER_CK(ck_binder());
108 the_lft.bn_left = bn_left;
109 the_lft.bn_right =
this;
110 bn_left->bn_right = &the_lft;
113 BINDER_CK(the_lft.ck_binder());
114 BINDER_CK(ck_binder());
121 bool is_last_in_grip(){
122 return (is_leftmost() && is_rightmost());
129 class grip :
public binder {
135 char* get_cls_name(){
136 return grip::CL_NAME;
145 return (! is_alone() && (bn_left == bn_right));
149 return (! is_alone() && ! is_single());
152 void move_all_to_my_right(grip& grp){
157 BINDER_CK(ck_binder());
159 binder* new_rgt = grp.bn_right;
160 binder* new_mid = grp.bn_left;
161 binder* old_rgt = bn_right;
167 bn_right->bn_left =
this;
169 new_mid->bn_right = old_rgt;
170 new_mid->bn_right->bn_left = new_mid;
172 BINDER_CK(grp.is_alone());
173 BINDER_CK(new_rgt->ck_binder());
174 BINDER_CK(new_mid->ck_binder());
175 BINDER_CK(old_rgt->ck_binder());
176 BINDER_CK(ck_binder());
179 void move_all_to_my_left(grip& grp){
184 BINDER_CK(ck_binder());
186 binder* new_lft = grp.bn_left;
187 binder* new_mid = grp.bn_right;
188 binder* old_lft = bn_left;
194 bn_left->bn_right =
this;
196 new_mid->bn_left = old_lft;
197 new_mid->bn_left->bn_right = new_mid;
199 BINDER_CK(grp.is_alone());
200 BINDER_CK(new_lft->ck_binder());
201 BINDER_CK(new_mid->ck_binder());
202 BINDER_CK(old_lft->ck_binder());
203 BINDER_CK(ck_binder());
212 void forced_let_go(){
216 template<
class obj_t1>
217 void append_all_as(row<obj_t1*>& rr,
bool clr =
false);
223 bool is_g = (get_cls_name() == grip::CL_NAME);
229 binder::is_leftmost(){
230 BINDER_CK(! is_grip());
231 return bn_left->is_grip();
236 binder::is_rightmost(){
237 BINDER_CK(! is_grip());
238 return bn_right->is_grip();
244 template<
class obj_t1>
245 class receptor :
public binder {
248 char* get_cls_name(){
249 return obj_t1::CL_NAME;
261 void init_receptor(){
265 receptor(obj_t1& tgt){
269 receptor(obj_t1* tgt){
273 operator obj_t1* () {
277 operator obj_t1& () {
278 BINDER_CK(re_me != NULL_PT);
286 template<
class obj_t1>
289 BINDER_CK(bdr != NULL_PT);
290 BINDER_CK(bdr->get_cls_name() == obj_t1::CL_NAME);
292 receptor<obj_t1>& rcp = *((receptor<obj_t1>*)(bdr));
293 BINDER_CK(rcp.re_me != NULL_PT);
300 template<
class obj_t1>
302 grip::append_all_as(row<obj_t1*>& rr,
bool clr){
307 binder* fst_bdr = bn_right;
308 binder* lst_bdr =
this;
309 for(binder* bdr_1 = fst_bdr; bdr_1 != lst_bdr; bdr_1 = bdr_1->bn_right){
310 obj_t1& ob_1 = rcp_as<obj_t1>(bdr_1);