/* STRUCT.hpp - key abstraction: structural asset Copyright (C) CinelerraCV 2007, 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. */ /** @file struct.hpp ** Structural facilities of the EDL (e.g. Tracks) can be treated in the ** "bookkeeping view" as a specific Kind of Asset. ** For the different Kinds of Assets, we use sub-intefaces inheriting ** from the general Asset interface. To be able to get asset::Struct instances ** directly from the AssetManager, we define a specialization of the Asset ID. ** ** @see asset.hpp for explanation ** @see StructFactory creating concrete asset::Struct instances ** */ #ifndef ASSET_STRUCT_H #define ASSET_STRUCT_H #include "proc/asset.hpp" #include "common/factory.hpp" #include using std::string; namespace asset { class Struct; class StructFactory; template<> class ID : public ID { public: ID (size_t id); ID (const Struct&); }; /** * key abstraction: structural asset * @todo just a stub, have to figure out what a asset::Proc is */ class Struct : public Asset { public: static StructFactory create; virtual const ID& getID() const ///< @return ID of kind asset::Struct { return static_cast& > (Asset::getID()); } protected: Struct (const Asset::Ident& idi) : Asset(idi) {} //////////////TODO friend class StructFactory; }; // definition of ID ctors is possible now, // after providing full definition of class Proc inline ID::ID(size_t id) : ID (id) {}; inline ID::ID(const Struct& stru) : ID (stru.getID()) {}; /** * Query for a special kind of structural Asset */ template class Query : public std::string { public: Query (string predicate) : string(predicate) {} }; /** * Factory specialized for createing Structural Asset objects. */ class StructFactory : public cinelerra::Factory { public: typedef shared_ptr PType; template shared_ptr operator() (Query query); ////////////TODO define actual operation }; } // namespace asset #endif