7 #ifndef DATATOOLS_UI_REFLECTIVE_COMMAND_INTERFACE_INL_H 8 #define DATATOOLS_UI_REFLECTIVE_COMMAND_INTERFACE_INL_H 29 const std::string & description_,
38 const std::string & name_,
39 const std::string & description_,
68 "Command interface is already initialized!");
71 "Command interface has no target!");
74 if (config_.
has_key(
"disabled_commands")) {
75 std::vector<std::string> discoms;
76 config_.
fetch(
"disabled_commands", discoms);
77 for (
auto discom : discoms) {
78 add_disabled_command(discom);
91 "Command interface is not initialized!");
92 _initialized_ =
false;
101 _disabled_commands_.insert(name_);
105 template <
class Type>
108 const camp::Class * metaclass = camp::classByTypeSafe<Type>();
109 DT_THROW_IF(metaclass ==
nullptr, std::logic_error,
110 "Class '" <<
typeid(Type).name() <<
"' has no reflection support!");
112 for (std::size_t ifunc = 0; ifunc < metaclass->functionCount(); ifunc++) {
113 const camp::Function & func = metaclass->function(ifunc);
117 if (_disabled_commands_.count(func.name()) != 0) {
129 template <
class Type>
139 #endif // DATATOOLS_UI_REFLECTIVE_COMMAND_INTERFACE_INL_H
bool is_initialized()
Check if Bayeux library core functionnalities are initialized.
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76