From b8128027fcf79ece3ed973627dd4e76eb36b5997 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 2 Aug 2020 13:33:36 +0200 Subject: Rename memory utility header --- include/ingen/AtomForge.hpp | 2 +- include/ingen/DataAccess.hpp | 2 +- include/ingen/EngineBase.hpp | 2 +- include/ingen/InstanceAccess.hpp | 2 +- include/ingen/Interface.hpp | 2 +- include/ingen/LV2Features.hpp | 2 +- include/ingen/Log.hpp | 2 +- include/ingen/Node.hpp | 2 +- include/ingen/Serialiser.hpp | 2 +- include/ingen/SocketReader.hpp | 2 +- include/ingen/SocketWriter.hpp | 2 +- include/ingen/Store.hpp | 2 +- include/ingen/Tee.hpp | 2 +- include/ingen/URIMap.hpp | 2 +- include/ingen/World.hpp | 2 +- include/ingen/client/ArcModel.hpp | 2 +- include/ingen/client/BlockModel.hpp | 2 +- include/ingen/client/ClientStore.hpp | 2 +- include/ingen/client/GraphModel.hpp | 2 +- include/ingen/client/ObjectModel.hpp | 2 +- include/ingen/client/PluginModel.hpp | 2 +- include/ingen/client/PluginUI.hpp | 2 +- include/ingen/client/PortModel.hpp | 2 +- include/ingen/memory.hpp | 54 ++++++++++++++++++++++++++++++++++++ include/ingen/types.hpp | 54 ------------------------------------ 25 files changed, 77 insertions(+), 77 deletions(-) create mode 100644 include/ingen/memory.hpp delete mode 100644 include/ingen/types.hpp (limited to 'include/ingen') diff --git a/include/ingen/AtomForge.hpp b/include/ingen/AtomForge.hpp index 24e42186..ac8d15aa 100644 --- a/include/ingen/AtomForge.hpp +++ b/include/ingen/AtomForge.hpp @@ -17,7 +17,7 @@ #ifndef INGEN_ATOMFORGE_HPP #define INGEN_ATOMFORGE_HPP -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lv2/atom/atom.h" #include "lv2/atom/forge.h" #include "lv2/atom/util.h" diff --git a/include/ingen/DataAccess.hpp b/include/ingen/DataAccess.hpp index acea8bd3..b06c8dec 100644 --- a/include/ingen/DataAccess.hpp +++ b/include/ingen/DataAccess.hpp @@ -21,7 +21,7 @@ #include "ingen/Node.hpp" #include "ingen/Store.hpp" #include "ingen/World.hpp" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lilv/lilv.h" #include "lv2/core/lv2.h" #include "lv2/data-access/data-access.h" diff --git a/include/ingen/EngineBase.hpp b/include/ingen/EngineBase.hpp index 36742601..f74612ac 100644 --- a/include/ingen/EngineBase.hpp +++ b/include/ingen/EngineBase.hpp @@ -18,7 +18,7 @@ #define INGEN_ENGINEBASE_HPP #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include #include diff --git a/include/ingen/InstanceAccess.hpp b/include/ingen/InstanceAccess.hpp index 782161f1..4d67d8db 100644 --- a/include/ingen/InstanceAccess.hpp +++ b/include/ingen/InstanceAccess.hpp @@ -21,7 +21,7 @@ #include "ingen/Node.hpp" #include "ingen/Store.hpp" #include "ingen/World.hpp" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lilv/lilv.h" #include "lv2/core/lv2.h" diff --git a/include/ingen/Interface.hpp b/include/ingen/Interface.hpp index 6ce12c6a..8a87af8b 100644 --- a/include/ingen/Interface.hpp +++ b/include/ingen/Interface.hpp @@ -26,7 +26,7 @@ #include "ingen/Resource.hpp" #include "ingen/Status.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include #include diff --git a/include/ingen/LV2Features.hpp b/include/ingen/LV2Features.hpp index 75d5b377..ae201bf6 100644 --- a/include/ingen/LV2Features.hpp +++ b/include/ingen/LV2Features.hpp @@ -18,7 +18,7 @@ #define INGEN_LV2FEATURES_HPP #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lv2/core/lv2.h" #include "raul/Noncopyable.hpp" diff --git a/include/ingen/Log.hpp b/include/ingen/Log.hpp index d668e873..96f03ae2 100644 --- a/include/ingen/Log.hpp +++ b/include/ingen/Log.hpp @@ -20,7 +20,7 @@ #include "ingen/LV2Features.hpp" #include "ingen/fmt.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lv2/core/lv2.h" #include "lv2/log/log.h" #include "lv2/urid/urid.h" diff --git a/include/ingen/Node.hpp b/include/ingen/Node.hpp index 148a9103..fd96d628 100644 --- a/include/ingen/Node.hpp +++ b/include/ingen/Node.hpp @@ -19,8 +19,8 @@ #include "ingen/Resource.hpp" #include "ingen/ingen.h" +#include "ingen/memory.hpp" #include "ingen/paths.hpp" -#include "ingen/types.hpp" #include "lilv/lilv.h" #include diff --git a/include/ingen/Serialiser.hpp b/include/ingen/Serialiser.hpp index 1ac5c151..7311d6ce 100644 --- a/include/ingen/Serialiser.hpp +++ b/include/ingen/Serialiser.hpp @@ -20,7 +20,7 @@ #include "ingen/FilePath.hpp" #include "ingen/Properties.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "sord/sordmm.hpp" #include diff --git a/include/ingen/SocketReader.hpp b/include/ingen/SocketReader.hpp index 85d1adc0..c9bc2a21 100644 --- a/include/ingen/SocketReader.hpp +++ b/include/ingen/SocketReader.hpp @@ -18,7 +18,7 @@ #define INGEN_SOCKETREADER_HPP #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "serd/serd.h" #include "sord/sord.h" diff --git a/include/ingen/SocketWriter.hpp b/include/ingen/SocketWriter.hpp index a5c651ef..458520a3 100644 --- a/include/ingen/SocketWriter.hpp +++ b/include/ingen/SocketWriter.hpp @@ -20,7 +20,7 @@ #include "ingen/Message.hpp" #include "ingen/TurtleWriter.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include diff --git a/include/ingen/Store.hpp b/include/ingen/Store.hpp index 1aa90936..fd801b02 100644 --- a/include/ingen/Store.hpp +++ b/include/ingen/Store.hpp @@ -18,7 +18,7 @@ #define INGEN_STORE_HPP #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "raul/Deletable.hpp" #include "raul/Noncopyable.hpp" #include "raul/Path.hpp" diff --git a/include/ingen/Tee.hpp b/include/ingen/Tee.hpp index 0a560f5c..a56f4dfe 100644 --- a/include/ingen/Tee.hpp +++ b/include/ingen/Tee.hpp @@ -19,7 +19,7 @@ #include "ingen/Interface.hpp" #include "ingen/Message.hpp" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include #include diff --git a/include/ingen/URIMap.hpp b/include/ingen/URIMap.hpp index 890917f1..cfd6d6d8 100644 --- a/include/ingen/URIMap.hpp +++ b/include/ingen/URIMap.hpp @@ -19,7 +19,7 @@ #include "ingen/LV2Features.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lv2/core/lv2.h" #include "lv2/urid/urid.h" #include "raul/Noncopyable.hpp" diff --git a/include/ingen/World.hpp b/include/ingen/World.hpp index e06c0a18..5c056ef7 100644 --- a/include/ingen/World.hpp +++ b/include/ingen/World.hpp @@ -18,7 +18,7 @@ #define INGEN_WORLD_HPP #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lv2/log/log.h" #include "lv2/urid/urid.h" #include "raul/Noncopyable.hpp" diff --git a/include/ingen/client/ArcModel.hpp b/include/ingen/client/ArcModel.hpp index e42dd7bd..582314ca 100644 --- a/include/ingen/client/ArcModel.hpp +++ b/include/ingen/client/ArcModel.hpp @@ -20,7 +20,7 @@ #include "ingen/Arc.hpp" #include "ingen/client/PortModel.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "raul/Path.hpp" #include diff --git a/include/ingen/client/BlockModel.hpp b/include/ingen/client/BlockModel.hpp index 5e17d31d..ac034242 100644 --- a/include/ingen/client/BlockModel.hpp +++ b/include/ingen/client/BlockModel.hpp @@ -21,7 +21,7 @@ #include "ingen/client/ObjectModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include #include diff --git a/include/ingen/client/ClientStore.hpp b/include/ingen/client/ClientStore.hpp index 54eaf373..77042109 100644 --- a/include/ingen/client/ClientStore.hpp +++ b/include/ingen/client/ClientStore.hpp @@ -23,7 +23,7 @@ #include "ingen/URI.hpp" #include "ingen/client/signal.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "raul/Path.hpp" #include diff --git a/include/ingen/client/GraphModel.hpp b/include/ingen/client/GraphModel.hpp index 2248e7e3..190c08eb 100644 --- a/include/ingen/client/GraphModel.hpp +++ b/include/ingen/client/GraphModel.hpp @@ -22,7 +22,7 @@ #include "ingen/client/BlockModel.hpp" #include "ingen/client/signal.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include diff --git a/include/ingen/client/ObjectModel.hpp b/include/ingen/client/ObjectModel.hpp index 39729377..a1e603f6 100644 --- a/include/ingen/client/ObjectModel.hpp +++ b/include/ingen/client/ObjectModel.hpp @@ -26,7 +26,7 @@ #include "ingen/URIs.hpp" #include "ingen/client/signal.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "raul/Path.hpp" #include "raul/Symbol.hpp" diff --git a/include/ingen/client/PluginModel.hpp b/include/ingen/client/PluginModel.hpp index 8afcd38f..9c5acc78 100644 --- a/include/ingen/client/PluginModel.hpp +++ b/include/ingen/client/PluginModel.hpp @@ -22,7 +22,7 @@ #include "ingen/World.hpp" #include "ingen/client/signal.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lilv/lilv.h" #include "raul/Symbol.hpp" #include "sord/sordmm.hpp" diff --git a/include/ingen/client/PluginUI.hpp b/include/ingen/client/PluginUI.hpp index 70ff7274..89c951c3 100644 --- a/include/ingen/client/PluginUI.hpp +++ b/include/ingen/client/PluginUI.hpp @@ -22,7 +22,7 @@ #include "ingen/LV2Features.hpp" #include "ingen/Resource.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lilv/lilv.h" #include "suil/suil.h" diff --git a/include/ingen/client/PortModel.hpp b/include/ingen/client/PortModel.hpp index c386dff0..46034b2f 100644 --- a/include/ingen/client/PortModel.hpp +++ b/include/ingen/client/PortModel.hpp @@ -19,7 +19,7 @@ #include "ingen/client/ObjectModel.hpp" #include "ingen/ingen.h" -#include "ingen/types.hpp" +#include "ingen/memory.hpp" #include "lv2/core/lv2.h" #include "lv2/port-props/port-props.h" diff --git a/include/ingen/memory.hpp b/include/ingen/memory.hpp new file mode 100644 index 00000000..dd56ac4b --- /dev/null +++ b/include/ingen/memory.hpp @@ -0,0 +1,54 @@ +/* + This file is part of Ingen. + Copyright 2007-2020 David Robillard + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see . +*/ + +#ifndef INGEN_MEMORY_HPP +#define INGEN_MEMORY_HPP + +#include "raul/Maid.hpp" + +#include +#include + +namespace ingen { + +template +void NullDeleter(T* ptr) {} + +template +struct FreeDeleter { void operator()(T* const ptr) { free(ptr); } }; + +template > +using UPtr = std::unique_ptr; + +template +using SPtr = std::shared_ptr; + +template +using WPtr = std::weak_ptr; + +template +using MPtr = Raul::managed_ptr; + +template +std::unique_ptr +make_unique(Args&&... args) +{ + return std::unique_ptr{new T{std::forward(args)...}}; +} + +} // namespace ingen + +#endif // INGEN_MEMORY_HPP diff --git a/include/ingen/types.hpp b/include/ingen/types.hpp deleted file mode 100644 index 2962d16a..00000000 --- a/include/ingen/types.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2015 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_TYPES_HPP -#define INGEN_TYPES_HPP - -#include "raul/Maid.hpp" - -#include -#include - -namespace ingen { - -template -void NullDeleter(T* ptr) {} - -template -struct FreeDeleter { void operator()(T* const ptr) { free(ptr); } }; - -template > -using UPtr = std::unique_ptr; - -template -using SPtr = std::shared_ptr; - -template -using WPtr = std::weak_ptr; - -template -using MPtr = Raul::managed_ptr; - -template -std::unique_ptr -make_unique(Args&&... args) -{ - return std::unique_ptr{new T{std::forward(args)...}}; -} - -} // namespace ingen - -#endif // INGEN_TYPES_HPP -- cgit v1.2.1