7 #ifndef __dg_command_bind_h__
8 #define __dg_command_bind_h__
23 #include <boost/assign/list_of.hpp>
24 #include <boost/bind.hpp>
25 #include <boost/function.hpp>
27 #include "dynamic-graph/command.h"
35 CommandVoid0(E &entity, boost::function<
void(
void)>
function,
36 const std::string &docString)
37 :
Command(entity, EMPTY_ARG, docString), fptr(
function) {}
47 boost::function<void(
void)> fptr;
51 CommandVoid0<E> *makeCommandVoid0(E &entity,
52 boost::function<
void(
void)>
function,
53 const std::string &docString) {
54 return new CommandVoid0<E>(entity,
function, docString);
58 CommandVoid0<E> *makeCommandVoid0(E &entity,
59 boost::function<
void(E *)>
function,
60 const std::string &docString) {
61 return new CommandVoid0<E>(entity, boost::bind(
function, &entity), docString);
65 CommandVoid0<E> *makeCommandVoid0(E &entity,
void (E::*
function)(
void),
66 const std::string &docString) {
67 return new CommandVoid0<E>(entity, boost::bind(
function, &entity), docString);
70 inline std::string docCommandVoid0(
const std::string &doc) {
71 return std::string(
"\n") + doc +
"\n\nNo input.\nVoid return.\n\n";
81 template <
class E,
typename T>
83 typedef boost::function<void(
const T &)> function_t;
85 CommandVoid1(E &entity, function_t
function,
const std::string &docString)
102 template <
class E,
typename T>
103 CommandVoid1<E, T> *makeCommandVoid1(
104 E &entity, boost::function<
void(
const T &)>
function,
106 const std::string &docString) {
107 return new CommandVoid1<E, T>(entity,
function, docString);
110 template <
class E,
typename T>
111 CommandVoid1<E, T> *makeCommandVoid1(
115 boost::function<
void(E *,
const T &)>
function,
116 const std::string &docString) {
117 return new CommandVoid1<E, T>(entity, boost::bind(
function, &entity, _1),
121 template <
class E,
typename T>
122 CommandVoid1<E, T> *makeCommandVoid1(E &entity,
void (E::*
function)(
const T &),
123 const std::string &docString) {
124 return new CommandVoid1<E, T>(entity, boost::bind(
function, &entity, _1),
129 inline std::string docCommandVoid1(
const std::string &doc,
130 const std::string &type) {
131 return std::string(
"\n") + doc +
"\n\nInput:\n - A " + type +
132 ".\nVoid return.\n\n";
142 template <
class E,
typename T1,
typename T2>
144 typedef boost::function<void(
const T1 &,
const T2 &)> function_t;
146 CommandVoid2(E &entity, function_t
function,
const std::string &docString)
166 template <
class E,
typename T1,
typename T2>
167 CommandVoid2<E, T1, T2> *makeCommandVoid2(
168 E &entity, boost::function<
void(
const T1 &,
const T2 &)>
function,
169 const std::string &docString) {
170 return new CommandVoid2<E, T1, T2>(entity,
function, docString);
173 template <
class E,
typename T1,
typename T2>
174 CommandVoid2<E, T1, T2> *makeCommandVoid2(
178 boost::function<
void(E *,
const T1 &,
const T2 &)>
function,
179 const std::string &docString) {
180 return new CommandVoid2<E, T1, T2>(
181 entity, boost::bind(
function, &entity, _1, _2), docString);
184 template <
class E,
typename T1,
typename T2>
185 CommandVoid2<E, T1, T2> *makeCommandVoid2(E &entity,
186 void (E::*
function)(
const T1 &,
188 const std::string &docString) {
189 return new CommandVoid2<E, T1, T2>(
190 entity, boost::bind(
function, &entity, _1, _2), docString);
194 inline std::string docCommandVoid2(
const std::string &doc,
195 const std::string &type1,
196 const std::string &type2) {
197 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
198 "Input:\n - A " + type2 +
".\n" +
"Void return.\n\n");
208 template <
class E,
typename T1,
typename T2,
typename T3>
210 typedef boost::function<void(
const T1 &,
const T2 &,
const T3 &)> function_t;
212 CommandVoid3(E &entity, function_t
function,
const std::string &docString)
225 fptr(val1, val2, val3);
233 template <
class E,
typename T1,
typename T2,
typename T3>
234 CommandVoid3<E, T1, T2, T3> *makeCommandVoid3(
235 E &entity,
typename CommandVoid3<E, T1, T2, T3>::function_t
function,
236 const std::string &docString) {
237 return new CommandVoid3<E, T1, T2, T3>(entity,
function, docString);
240 template <
class E,
typename T1,
typename T2,
typename T3>
241 CommandVoid3<E, T1, T2, T3> *makeCommandVoid3(
245 boost::function<
void(E *,
const T1 &,
const T2 &,
const T3 &)>
function,
246 const std::string &docString) {
247 return new CommandVoid3<E, T1, T2, T3>(
248 entity, boost::bind(
function, &entity, _1, _2, _3), docString);
251 template <
class E,
typename T1,
typename T2,
typename T3>
252 CommandVoid3<E, T1, T2, T3> *makeCommandVoid3(
253 E &entity,
void (E::*
function)(
const T1 &,
const T2 &,
const T3 &),
254 const std::string &docString) {
255 return new CommandVoid3<E, T1, T2, T3>(
256 entity, boost::bind(
function, &entity, _1, _2, _3), docString);
260 inline std::string docCommandVoid3(
const std::string &doc,
261 const std::string &type1,
262 const std::string &type2,
263 const std::string &type3) {
264 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
265 "Input:\n - A " + type2 +
".\n" +
"Input:\n - A " + type3 +
".\n" +
276 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4>
278 typedef boost::function<void(
const T1 &,
const T2 &,
const T3 &,
const T4 &)>
280 typedef void (E::*memberFunction_ptr_t)(
const T1 &,
const T2 &,
const T3 &,
283 CommandVoid4(E &entity, function_t
function,
const std::string &docString)
298 fptr(val1, val2, val3, val4);
306 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4>
307 CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
308 E &entity,
typename CommandVoid4<E, T1, T2, T3, T4>::function_t
function,
309 const std::string &docString) {
310 return new CommandVoid4<E, T1, T2, T3, T4>(entity,
function, docString);
313 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4>
314 CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
316 boost::function<
void(E *,
const T1 &,
const T2 &,
const T3 &,
const T4 &)>
318 const std::string &docString) {
319 return new CommandVoid4<E, T1, T2, T3, T4>(
320 entity, boost::bind(
function, &entity, _1, _2, _3, _4), docString);
323 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4>
324 CommandVoid4<E, T1, T2, T3, T4> *makeCommandVoid4(
326 void (E::*
function)(
const T1 &,
const T2 &,
const T3 &,
const T4 &),
327 const std::string &docString) {
328 return new CommandVoid4<E, T1, T2, T3, T4>(
329 entity, boost::bind(
function, &entity, _1, _2, _3, _4), docString);
333 inline std::string docCommandVoid4(
const std::string &doc,
334 const std::string &type1,
335 const std::string &type2,
336 const std::string &type3,
337 const std::string &type4) {
338 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
339 "Input:\n - A " + type2 +
".\n" +
"Input:\n - A " + type3 +
".\n" +
340 "Input:\n - A " + type4 +
".\n" +
"Void return.\n\n");
350 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
353 typedef boost::function<void(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
356 typedef void (E::*memberFunction_ptr_t)(
const T1 &,
const T2 &,
const T3 &,
357 const T4 &,
const T5 &);
359 CommandVoid5(E &entity, function_t
function,
const std::string &docString)
375 fptr(val1, val2, val3, val4, val5);
383 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
385 CommandVoid5<E, T1, T2, T3, T4, T5> *makeCommandVoid5(
387 typename CommandVoid5<E, T1, T2, T3, T4, T5>::function_t
function,
388 const std::string &docString) {
389 return new CommandVoid5<E, T1, T2, T3, T4, T5>(entity,
function, docString);
392 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
394 CommandVoid5<E, T1, T2, T3, T4, T5> *makeCommandVoid5(
396 boost::function<
void(E *,
const T1 &,
const T2 &,
const T3 &,
const T4 &,
399 const std::string &docString) {
400 return new CommandVoid5<E, T1, T2, T3, T4, T5>(
401 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5), docString);
404 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
406 CommandVoid5<E, T1, T2, T3, T4, T5> *makeCommandVoid5(
408 void (E::*
function)(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
410 const std::string &docString) {
411 return new CommandVoid5<E, T1, T2, T3, T4, T5>(
412 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5), docString);
416 inline std::string docCommandVoid5(
const std::string &doc,
417 const std::string &type1,
418 const std::string &type2,
419 const std::string &type3,
420 const std::string &type4,
421 const std::string &type5) {
422 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
423 "Input:\n - A " + type2 +
".\n" +
"Input:\n - A " + type3 +
".\n" +
424 "Input:\n - A " + type4 +
".\n" +
"Input:\n - A " + type5 +
".\n" +
435 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
436 typename T5,
typename T6>
438 typedef boost::function<void(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
439 const T5 &,
const T6 &)>
441 typedef void (E::*memberFunction_ptr_t)(
const T1 &,
const T2 &,
const T3 &,
442 const T4 &,
const T5 &,
const T6 &);
444 CommandVoid6(E &entity, function_t
function,
const std::string &docString)
462 fptr(val1, val2, val3, val4, val5, val6);
470 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
471 typename T5,
typename T6>
472 CommandVoid6<E, T1, T2, T3, T4, T5, T6> *makeCommandVoid6(
474 typename CommandVoid6<E, T1, T2, T3, T4, T5, T6>::function_t
function,
475 const std::string &docString) {
476 return new CommandVoid6<E, T1, T2, T3, T4, T5, T6>(entity,
function,
480 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
481 typename T5,
typename T6>
482 CommandVoid6<E, T1, T2, T3, T4, T5, T6> *makeCommandVoid6(
484 boost::function<
void(E *,
const T1 &,
const T2 &,
const T3 &,
const T4 &,
485 const T5 &,
const T6 &)>
487 const std::string &docString) {
488 return new CommandVoid6<E, T1, T2, T3, T4, T5, T6>(
489 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5, _6),
493 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
494 typename T5,
typename T6>
495 CommandVoid6<E, T1, T2, T3, T4, T5, T6> *makeCommandVoid6(
497 void (E::*
function)(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
498 const T5 &,
const T6 &),
499 const std::string &docString) {
500 return new CommandVoid6<E, T1, T2, T3, T4, T5, T6>(
501 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5, _6),
506 inline std::string docCommandVoid6(
507 const std::string &doc,
const std::string &type1,
const std::string &type2,
508 const std::string &type3,
const std::string &type4,
509 const std::string &type5,
const std::string &type6) {
510 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
511 "Input:\n - A " + type2 +
".\n" +
"Input:\n - A " + type3 +
".\n" +
512 "Input:\n - A " + type4 +
".\n" +
"Input:\n - A " + type5 +
".\n" +
513 "Input:\n - A " + type6 +
".\n" +
"Void return.\n\n");
523 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
524 typename T5,
typename T6,
typename T7>
526 typedef boost::function<void(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
527 const T5 &,
const T6 &,
const T7 &)>
529 typedef void (E::*memberFunction_ptr_t)(
const T1 &,
const T2 &,
const T3 &,
530 const T4 &,
const T5 &,
const T6 &,
533 CommandVoid7(E &entity, function_t
function,
const std::string &docString)
552 fptr(val1, val2, val3, val4, val5, val6, val7);
560 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
561 typename T5,
typename T6,
typename T7>
562 CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7> *makeCommandVoid7(
564 typename CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7>::function_t
function,
565 const std::string &docString) {
566 return new CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7>(entity,
function,
570 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
571 typename T5,
typename T6,
typename T7>
572 CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7> *makeCommandVoid7(
574 boost::function<
void(E *,
const T1 &,
const T2 &,
const T3 &,
const T4 &,
575 const T5 &,
const T6 &,
const T7 &)>
577 const std::string &docString) {
578 return new CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7>(
579 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5, _6, _7),
583 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
584 typename T5,
typename T6,
typename T7>
585 CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7> *makeCommandVoid7(
587 void (E::*
function)(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
588 const T5 &,
const T6 &,
const T7 &),
589 const std::string &docString) {
590 return new CommandVoid7<E, T1, T2, T3, T4, T5, T6, T7>(
591 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5, _6, _7),
596 inline std::string docCommandVoid7(
597 const std::string &doc,
const std::string &type1,
const std::string &type2,
598 const std::string &type3,
const std::string &type4,
599 const std::string &type5,
const std::string &type6,
600 const std::string &type7) {
601 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
602 "Input:\n - A " + type2 +
".\n" +
"Input:\n - A " + type3 +
".\n" +
603 "Input:\n - A " + type4 +
".\n" +
"Input:\n - A " + type5 +
".\n" +
604 "Input:\n - A " + type6 +
".\n" +
"Input:\n - A " + type7 +
".\n" +
615 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
616 typename T5,
typename T6,
typename T7,
typename T8>
618 typedef boost::function<void(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
619 const T5 &,
const T6 &,
const T7 &,
const T8 &)>
621 typedef void (E::*memberFunction_ptr_t)(
const T1 &,
const T2 &,
const T3 &,
622 const T4 &,
const T5 &,
const T6 &,
623 const T7 &,
const T8 &);
625 CommandVoid8(E &entity, function_t
function,
const std::string &docString)
646 fptr(val1, val2, val3, val4, val5, val6, val7, val8);
654 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
655 typename T5,
typename T6,
typename T7,
typename T8>
656 CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8> *makeCommandVoid8(
658 typename CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8>::function_t
660 const std::string &docString) {
661 return new CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8>(entity,
function,
665 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
666 typename T5,
typename T6,
typename T7,
typename T8>
667 CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8> *makeCommandVoid8(
669 boost::function<
void(E *,
const T1 &,
const T2 &,
const T3 &,
const T4 &,
670 const T5 &,
const T6 &,
const T7 &,
const T8 &)>
672 const std::string &docString) {
673 return new CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8>(
674 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5, _6, _7, _8),
678 template <
class E,
typename T1,
typename T2,
typename T3,
typename T4,
679 typename T5,
typename T6,
typename T7,
typename T8>
680 CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8> *makeCommandVoid8(
682 void (E::*
function)(
const T1 &,
const T2 &,
const T3 &,
const T4 &,
683 const T5 &,
const T6 &,
const T7 &,
const T8 &),
684 const std::string &docString) {
685 return new CommandVoid8<E, T1, T2, T3, T4, T5, T6, T7, T8>(
686 entity, boost::bind(
function, &entity, _1, _2, _3, _4, _5, _6, _7, _8),
691 inline std::string docCommandVoid8(
692 const std::string &doc,
const std::string &type1,
const std::string &type2,
693 const std::string &type3,
const std::string &type4,
694 const std::string &type5,
const std::string &type6,
695 const std::string &type7,
const std::string &type8) {
696 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
697 "Input:\n - A " + type2 +
".\n" +
"Input:\n - A " + type3 +
".\n" +
698 "Input:\n - A " + type4 +
".\n" +
"Input:\n - A " + type5 +
".\n" +
699 "Input:\n - A " + type6 +
".\n" +
"Input:\n - A " + type7 +
".\n" +
700 "Input:\n - A " + type8 +
".\n" +
"Void return.\n\n");
714 typedef boost::function<void(std::ostream &)> function_t;
716 CommandVerbose(E &entity, function_t
function,
const std::string &docString)
717 :
Command(entity, EMPTY_ARG, docString), fptr(
function) {}
722 std::ostringstream oss;
724 return Value(oss.str());
732 CommandVerbose<E> *makeCommandVerbose(
733 E &entity,
typename CommandVerbose<E>::function_t
function,
734 const std::string &docString) {
735 return new CommandVerbose<E>(entity,
function, docString);
740 CommandVerbose<E> *makeCommandVerbose(E &entity,
741 void (E::*
function)(std::ostream &),
742 const std::string &docString) {
743 return new CommandVerbose<E>(entity, boost::bind(
function, &entity, _1),
748 inline std::string docCommandVerbose(
const std::string &doc) {
749 return std::string(
"\n") + doc +
"\n\nNo input.\n Return a string.\n\n";
755 template <
class E,
class ReturnType>
758 const std::string &docString)
759 :
Command(entity, EMPTY_ARG, docString), fptr(
function) {}
769 boost::function<ReturnType(
void)> fptr;
772 template <
class E,
class ReturnType>
773 CommandReturnType0<E, ReturnType> *makeCommandReturnType0(
774 E &entity, boost::function<ReturnType(
void)>
function,
775 const std::string &docString) {
776 return new CommandReturnType0<E, ReturnType>(entity,
function, docString);
779 template <
class E,
class ReturnType>
780 CommandReturnType0<E, ReturnType> *makeCommandReturnType0(
781 E &entity, boost::function<ReturnType(E *)>
function,
782 const std::string &docString) {
783 return new CommandReturnType0<E, ReturnType>(
784 entity, boost::bind(
function, &entity), docString);
787 template <
class E,
class ReturnType>
788 CommandReturnType0<E, ReturnType> *makeCommandReturnType0(
789 E &entity, ReturnType (E::*
function)(
void),
const std::string &docString) {
790 return new CommandReturnType0<E, ReturnType>(
791 entity, boost::bind(
function, &entity), docString);
794 template <
typename ReturnType>
795 inline std::string docCommandReturnType0(
796 const std::string &doc,
const std::string & ) {
797 return std::string(
"\n") + doc +
"\n\nNo input.\n" +
798 typeid(ReturnType).name() +
" return.\n\n";
808 template <
class E,
typename ReturnType,
typename T>
810 typedef boost::function<ReturnType(
const T &)> function_t;
813 const std::string &docString)
822 Value res(fptr(val));
830 template <
class E,
typename ReturnType,
typename T>
831 CommandReturnType1<E, ReturnType, T> *makeCommandReturnType1(
832 E &entity, boost::function<ReturnType(
const T &)>
function,
833 const std::string &docString) {
834 return new CommandReturnType1<E, ReturnType, T>(entity,
function, docString);
837 template <
class E,
typename ReturnType,
typename T>
838 CommandReturnType1<E, ReturnType, T> *makeCommandReturnType1(
842 boost::function<ReturnType(E *,
const T &)>
function,
843 const std::string &docString) {
844 return new CommandReturnType1<E, ReturnType, T>(
845 entity, boost::bind(
function, &entity, _1), docString);
848 template <
class E,
typename ReturnType,
typename T>
849 CommandReturnType1<E, ReturnType, T> *makeCommandReturnType1(
850 E &entity, ReturnType (E::*
function)(
const T &),
851 const std::string &docString) {
852 return new CommandReturnType1<E, ReturnType, T>(
853 entity, boost::bind(
function, &entity, _1), docString);
857 template <
typename ReturnType>
858 inline std::string docCommandReturnType1(
const std::string &doc,
859 const std::string &type) {
860 return std::string(
"\n") + doc +
"\n\nInput:\n - A " + type +
".\n" +
861 typeid(ReturnType).name() +
"return.\n\n";
871 template <
class E,
typename ReturnType,
typename T1,
typename T2>
873 typedef boost::function<ReturnType(
const T1 &,
const T2 &)> function_t;
876 const std::string &docString)
888 Value res(fptr(val1, val2));
896 template <
class E,
typename ReturnType,
typename T1,
typename T2>
897 CommandReturnType2<E, ReturnType, T1, T2> *makeCommandReturnType2(
898 E &entity, boost::function<ReturnType(
const T1 &,
const T2 &)>
function,
899 const std::string &docString) {
900 return new CommandReturnType2<E, ReturnType, T1, T2>(entity,
function,
904 template <
class E,
typename ReturnType,
typename T1,
typename T2>
905 CommandReturnType2<E, ReturnType, T1, T2> *makeCommandReturnType2(
909 boost::function<ReturnType(E *,
const T1 &,
const T2 &)>
function,
910 const std::string &docString) {
911 return new CommandReturnType2<E, ReturnType, T1, T2>(
912 entity, boost::bind(
function, &entity, _1, _2), docString);
915 template <
class E,
typename ReturnType,
typename T1,
typename T2>
916 CommandReturnType2<E, ReturnType, T1, T2> *makeCommandReturnType2(
917 E &entity, ReturnType (E::*
function)(
const T1 &,
const T2 &),
918 const std::string &docString) {
919 return new CommandReturnType2<E, ReturnType, T1, T2>(
920 entity, boost::bind(
function, &entity, _1, _2), docString);
924 template <
typename ReturnType>
925 inline std::string docCommandReturnType2(
const std::string &doc,
926 const std::string &type1,
927 const std::string &type2) {
928 return (std::string(
"\n") + doc +
"\n\n" +
"Input:\n - A " + type1 +
".\n" +
929 "Input:\n - A " + type2 +
".\n" +
930 "ReturnType:\n - Returns:" +
typeid(ReturnType).name() + +
".\n\n");
936 #endif // __dg_command_bind_h__