2007-11-23 04:37:50 +01:00
|
|
|
/*
|
2010-02-22 03:52:52 +01:00
|
|
|
TestClip - test clip (stub) for checking Model/Session functionality
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-11-23 04:37:50 +01:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2007-11-23 04:37:50 +01:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-11-23 04:37:50 +01:00
|
|
|
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.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2007-11-23 04:37:50 +01:00
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "proc/asset/testasset.hpp"
|
|
|
|
|
#include "proc/assetmanager.hpp"
|
|
|
|
|
|
|
|
|
|
using std::tr1::static_pointer_cast;
|
|
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
|
|
|
|
|
namespace proc {
|
|
|
|
|
namespace asset{
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
namespace
|
2007-11-23 04:37:50 +01:00
|
|
|
{
|
2011-12-02 17:50:44 +01:00
|
|
|
uint counter (0);
|
2007-11-23 04:37:50 +01:00
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
/** @internal helper generating continuously
|
|
|
|
|
* different new asset identities
|
2007-11-23 04:37:50 +01:00
|
|
|
*/
|
2011-12-02 17:50:44 +01:00
|
|
|
Asset::Ident
|
|
|
|
|
make_new_ident ()
|
2007-11-23 04:37:50 +01:00
|
|
|
{
|
2011-12-02 17:50:44 +01:00
|
|
|
return Asset::Ident ( str(format("TestAsset.%i") % counter)
|
|
|
|
|
, Category (META)
|
|
|
|
|
, "test"
|
|
|
|
|
, counter++
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
Asset::Ident
|
|
|
|
|
make_new_ident (PAsset& ref)
|
|
|
|
|
{
|
|
|
|
|
return Asset::Ident ( str(format("%s-TestAsset.%i") % ref->ident.name
|
|
|
|
|
% counter)
|
|
|
|
|
, ref->ident.category
|
|
|
|
|
, "test"
|
|
|
|
|
, counter++
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-11-23 04:37:50 +01:00
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
template<class A>
|
|
|
|
|
TestAsset<A>::TestAsset ()
|
|
|
|
|
: A(make_new_ident ())
|
|
|
|
|
{ };
|
2007-11-23 04:37:50 +01:00
|
|
|
|
|
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
template<class A>
|
|
|
|
|
TestAsset<A>::TestAsset (PAsset& pRef)
|
|
|
|
|
: A(make_new_ident (pRef))
|
|
|
|
|
{
|
|
|
|
|
this->defineDependency(pRef);
|
|
|
|
|
};
|
2007-11-23 04:37:50 +01:00
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
|
|
|
|
|
/** @internal helper for the create()-Functions
|
|
|
|
|
* retrieving the smart ptr created automatically
|
|
|
|
|
* within AssetManager by the Asset base class ctor
|
|
|
|
|
*/
|
|
|
|
|
template<class A>
|
|
|
|
|
P<TestAsset<A> >
|
|
|
|
|
TestAsset<A>::ptrFromThis ()
|
|
|
|
|
{
|
|
|
|
|
return static_pointer_cast<TestAsset<A>,Asset>
|
|
|
|
|
(AssetManager::instance().getAsset (this->id));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}}} // namespace proc::asset::test
|
|
|
|
|
|
2007-11-23 04:37:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************/
|
|
|
|
|
/* explicit template instantiations for some Asset Kinds */
|
|
|
|
|
/*********************************************************/
|
|
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
#include "proc/asset/unknown.hpp"
|
2007-11-23 04:37:50 +01:00
|
|
|
|
|
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
namespace proc {
|
|
|
|
|
namespace asset{
|
|
|
|
|
namespace test {
|
2007-11-23 04:37:50 +01:00
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
template TestAsset<Asset>::TestAsset ();
|
|
|
|
|
template TestAsset<Unknown>::TestAsset ();
|
|
|
|
|
|
|
|
|
|
template TestAsset<Asset>::TestAsset (PAsset& pRef);
|
|
|
|
|
template TestAsset<Unknown>::TestAsset (PAsset& pRef);
|
|
|
|
|
|
|
|
|
|
template P<TestAsset<Asset> > TestAsset<Asset>::ptrFromThis ();
|
|
|
|
|
template P<TestAsset<Unknown> > TestAsset<Unknown>::ptrFromThis ();
|
2007-11-23 04:37:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-02 17:50:44 +01:00
|
|
|
}}} // namespace proc::asset::test
|