diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp index 69bcd8a38..0f8560ad1 100644 --- a/src/proc/asset.cpp +++ b/src/proc/asset.cpp @@ -23,6 +23,7 @@ #include "proc/asset.hpp" #include "proc/assetmanager.hpp" +#include "proc/asset/asset-format.hpp" #include "lib/util-foreach.hpp" #include "lib/util.hpp" diff --git a/src/proc/asset/asset-format.hpp b/src/proc/asset/asset-format.hpp new file mode 100644 index 000000000..8ee6c71ce --- /dev/null +++ b/src/proc/asset/asset-format.hpp @@ -0,0 +1,53 @@ +/* + ASSET-FORMAT.hpp - helpers for display of asset entities + + Copyright (C) Lumiera.org + 2011, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef ASSET_ASSET_FORMAT_H +#define ASSET_ASSET_FORMAT_H + +#include "proc/asset.hpp" +#include "proc/asset/category.hpp" + +#include + + + +namespace asset { + + + inline std::ostream& + operator<< (std::ostream& os, Category const& cat) + { + return os << string(cat); + } + + inline std::ostream& + operator<< (std::ostream& os, Asset::Ident const& idi) + { + return os << string(idi); + } + + + + +} // namespace asset +#endif diff --git a/src/proc/asset/category.hpp b/src/proc/asset/category.hpp index aa263ee7d..b7c8df2f2 100644 --- a/src/proc/asset/category.hpp +++ b/src/proc/asset/category.hpp @@ -27,7 +27,6 @@ #include "lib/symbol.hpp" #include -#include #include @@ -101,12 +100,6 @@ namespace asset { }; - inline ostream& - operator<< (ostream& os, Category const& cat) - { - return os << string(cat); - } - inline size_t hash_value (Category const& cat) { diff --git a/tests/components/proc/asset/asset-category-test.cpp b/tests/components/proc/asset/asset-category-test.cpp index bc0676011..7bfb68f4e 100644 --- a/tests/components/proc/asset/asset-category-test.cpp +++ b/tests/components/proc/asset/asset-category-test.cpp @@ -25,6 +25,7 @@ #include "lib/util.hpp" #include "proc/asset/category.hpp" +#include "proc/asset/asset-format.hpp" #include #include diff --git a/tests/components/proc/asset/asset-diagnostics.hpp b/tests/components/proc/asset/asset-diagnostics.hpp index 08619bbba..76788d3f5 100644 --- a/tests/components/proc/asset/asset-diagnostics.hpp +++ b/tests/components/proc/asset/asset-diagnostics.hpp @@ -50,42 +50,42 @@ using std::string; using std::cout; -namespace asset - { - +namespace asset { + inline void dump (PcAsset& aa) - { - if (!aa) - cout << "Asset(NULL)\n"; - else - { - format fmt("%s %|50T.| id=%s adr=%p smart-ptr=%p use-count=%u"); - cout << fmt % str(aa) % aa->getID() % aa.get() % &aa % (aa.use_count() - 1) << "\n"; - } } - + { + if (!aa) + cout << "Asset(NULL)\n"; + else + { + format fmt("%s %|50T.| id=%s adr=%p smart-ptr=%p use-count=%u"); + cout << fmt % str(aa) % aa->getID() % aa.get() % &aa % (aa.use_count() - 1) << "\n"; + } } + + inline void dumpAssetManager () - { - list assets (AssetManager::instance().listContent()); - cout << "----all-registered-Assets----\n"; - for_each (assets, bind (&dump, _1)); - } + { + list assets (AssetManager::instance().listContent()); + cout << "----all-registered-Assets----\n"; + for_each (assets, bind (&dump, _1)); + } template inline bool dependencyCheck (P child, P parent) - { - return (child == parent) - || (0 < child->getParents().size() - && (parent == child->getParents()[0]) - && (contains (parent->getDependant(), child))) - ; - } - - - - + { + return (child == parent) + || (0 < child->getParents().size() + && (parent == child->getParents()[0]) + && (contains (parent->getDependant(), child))) + ; + } + + + + } // namespace asset #endif