// This file is part of VSTGUI. It is subject to the license terms // in the LICENSE file found in the top-level directory of this // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE #pragma once #include "iuidescriptionaddon.h" #include #include //------------------------------------------------------------------------ namespace VSTGUI { //------------------------------------------------------------------------ class UIDescriptionAddOnRegistry { public: using AddOnID = uint64_t; static AddOnID add (std::unique_ptr&& addOn); static void remove (AddOnID identifier); template static void forEach (Proc p) { for (auto& el : instance ()) { p (*el.addOn.get ()); } } private: static UIDescriptionAddOnRegistry& instance (); UIDescriptionAddOnRegistry (); ~UIDescriptionAddOnRegistry () noexcept; struct AddOn { AddOnID identifier; std::unique_ptr addOn; }; using iterator = std::vector::iterator; iterator begin (); iterator end (); struct Impl; std::unique_ptr impl; }; //------------------------------------------------------------------------ } // VSTGUI