2007-09-02 18:48:22 +02:00
|
|
|
/*
|
|
|
|
|
STRUCT.hpp - key abstraction: structural asset
|
|
|
|
|
|
2008-03-10 04:25:03 +01:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Hermann Vosseler <Ichthyostega@web.de>
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2007-09-16 03:02:05 +02:00
|
|
|
/** @file struct.hpp
|
2010-02-22 03:52:52 +01:00
|
|
|
** Structural parts of the Session (e.g. Tracks) can be reflected
|
|
|
|
|
** into the "bookkeeping view" as a specific Kind of Asset.
|
|
|
|
|
** For the different <i>Kinds</i> of Assets, we use sub-interfaces inheriting
|
2007-09-16 03:02:05 +02:00
|
|
|
** from the general Asset interface. To be able to get asset::Struct instances
|
2010-02-22 03:52:52 +01:00
|
|
|
** directly from the AssetManager, we define a specialisation of the Asset ID.
|
2007-09-16 03:02:05 +02:00
|
|
|
**
|
|
|
|
|
** @see asset.hpp for explanation
|
|
|
|
|
** @see StructFactory creating concrete asset::Struct instances
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
#ifndef ASSET_STRUCT_H
|
|
|
|
|
#define ASSET_STRUCT_H
|
|
|
|
|
|
2008-04-12 04:55:18 +02:00
|
|
|
#include "pre_a.hpp"
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
#include "proc/asset.hpp"
|
2008-12-17 17:53:32 +01:00
|
|
|
#include "lib/query.hpp"
|
|
|
|
|
#include "lib/factory.hpp"
|
|
|
|
|
#include "lib/singleton.hpp"
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2008-02-10 17:23:16 +01:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
#include <string>
|
2008-01-07 18:16:03 +01:00
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
|
|
|
|
|
|
2009-01-05 16:17:17 +01:00
|
|
|
namespace asset {
|
|
|
|
|
|
2008-03-31 03:21:28 +02:00
|
|
|
using std::string;
|
|
|
|
|
using std::wstring;
|
|
|
|
|
using boost::scoped_ptr;
|
2008-03-10 08:38:59 +01:00
|
|
|
using lumiera::Query;
|
2007-09-16 03:02:05 +02:00
|
|
|
|
|
|
|
|
class Struct;
|
|
|
|
|
class StructFactory;
|
2008-02-10 17:23:16 +01:00
|
|
|
class StructFactoryImpl;
|
2008-02-14 04:12:30 +01:00
|
|
|
class Pipe;
|
2007-09-16 03:02:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
|
class ID<Struct> : public ID<Asset>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ID (size_t id);
|
|
|
|
|
ID (const Struct&);
|
|
|
|
|
};
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2007-09-16 03:02:05 +02:00
|
|
|
|
|
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
/**
|
|
|
|
|
* key abstraction: structural asset
|
2008-09-12 03:42:32 +02:00
|
|
|
* @todo just a stub, have to figure out what a asset::Struct is
|
2010-02-28 07:17:12 +01:00
|
|
|
* @todo WIP as of 1/2010. Need to integrate Sequences and Timelines
|
2007-09-02 18:48:22 +02:00
|
|
|
*/
|
|
|
|
|
class Struct : public Asset
|
|
|
|
|
{
|
2007-09-16 03:02:05 +02:00
|
|
|
public:
|
|
|
|
|
static StructFactory create;
|
2007-09-02 18:48:22 +02:00
|
|
|
|
2010-02-28 07:17:12 +01:00
|
|
|
virtual const ID<Struct>&
|
|
|
|
|
getID() const ///< @return ID of kind asset::Struct
|
2007-09-16 03:02:05 +02:00
|
|
|
{
|
|
|
|
|
return static_cast<const ID<Struct>& > (Asset::getID());
|
|
|
|
|
}
|
|
|
|
|
|
2008-02-15 02:56:25 +01:00
|
|
|
const string queryStreamID() const;
|
2008-02-18 04:16:53 +01:00
|
|
|
const string queryPipeID() const;
|
2008-02-15 02:56:25 +01:00
|
|
|
|
|
|
|
|
|
2007-09-16 03:02:05 +02:00
|
|
|
protected:
|
2008-01-12 18:19:37 +01:00
|
|
|
Struct (const Asset::Ident& idi) : Asset(idi) {}
|
2007-09-16 03:02:05 +02:00
|
|
|
friend class StructFactory;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// definition of ID<Struct> ctors is possible now,
|
2010-02-28 07:17:12 +01:00
|
|
|
// after providing full definition of class Struct
|
2007-09-16 03:02:05 +02:00
|
|
|
|
|
|
|
|
inline ID<Struct>::ID(size_t id) : ID<Asset> (id) {};
|
|
|
|
|
inline ID<Struct>::ID(const Struct& stru) : ID<Asset> (stru.getID()) {};
|
|
|
|
|
|
|
|
|
|
|
2008-01-14 01:01:11 +01:00
|
|
|
|
|
|
|
|
|
2007-09-16 03:02:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2009-01-05 16:17:17 +01:00
|
|
|
* Factory specialised for creating Structural Asset objects.
|
2007-09-16 03:02:05 +02:00
|
|
|
*/
|
2009-09-30 00:27:14 +02:00
|
|
|
class StructFactory : public lib::Factory<asset::Struct>
|
2007-09-16 03:02:05 +02:00
|
|
|
{
|
2008-02-10 17:23:16 +01:00
|
|
|
scoped_ptr<StructFactoryImpl> impl_;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
StructFactory ();
|
|
|
|
|
friend class Struct;
|
|
|
|
|
|
|
|
|
|
|
2007-09-16 03:02:05 +02:00
|
|
|
public:
|
2008-05-19 08:46:19 +02:00
|
|
|
typedef P<asset::Struct> PType;
|
2008-01-07 18:16:03 +01:00
|
|
|
|
|
|
|
|
template<class STRU>
|
2010-02-28 07:17:12 +01:00
|
|
|
P<STRU> operator() (const Query<STRU>& query); ////////////TODO for now we're just using a fake config query with preconfigured hardwired answers
|
2008-01-14 01:01:11 +01:00
|
|
|
|
2008-05-19 08:46:19 +02:00
|
|
|
P<Pipe> operator() (string pipeID, string streamID);
|
2008-02-10 17:23:16 +01:00
|
|
|
|
2007-09-02 18:48:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace asset
|
|
|
|
|
#endif
|