#include "MessageLoader.h" #include "componentinfo_access.h" #include "entity_operate.h" #include "motion_access.h" #include "route_access.h" #include "visiblecube_access.h" MessageLoader::MessageLoader() { _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); _message_types << std::make_shared(); } #include QList MessageLoader::allType() const { QMutexLocker o(&const_cast(this)->_type_mutex); QList keys; std::transform(_message_types.begin(), _message_types.end(), std::back_inserter(keys), [](std::shared_ptr ins) { return ins->topicString(); }); return keys; } std::shared_ptr MessageLoader::makeDefault(const QString& topic) const { QMutexLocker o(&const_cast(this)->_type_mutex); for(auto it : this->_message_types) if(it->topicString() == topic) return std::dynamic_pointer_cast(it->newDefault()); return nullptr; }