2010-03-24 05:00:06 +01:00
|
|
|
/*
|
|
|
|
|
STRUCT-SCHEME.hpp - naming and designation scheme for structural assets
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2010, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
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-scheme.hpp
|
|
|
|
|
** Naming and labelling scheme for structural assets.
|
|
|
|
|
** Preconfigured traits data for the relevant types encountered in
|
|
|
|
|
** Lumiera's session data model.
|
|
|
|
|
**
|
|
|
|
|
** @see struct-factory-impl.hpp
|
|
|
|
|
** @see entry-id.hpp
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ASSET_STRUCT_SCHEME_H
|
|
|
|
|
#define ASSET_STRUCT_SCHEME_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#include "proc/mobject/session.hpp"
|
|
|
|
|
//#include "proc/mobject/mobject.hpp"
|
|
|
|
|
|
|
|
|
|
#include "lib/symbol.hpp"
|
|
|
|
|
//#include "lib/error.hpp"
|
|
|
|
|
//#include "lib/util.hpp"
|
|
|
|
|
|
|
|
|
|
//#include <boost/format.hpp>
|
|
|
|
|
|
|
|
|
|
#include <boost/format.hpp>
|
|
|
|
|
using boost::format;
|
|
|
|
|
/////////////////////////////////////////////////////////TODO needs to be pushed down into a *.cpp
|
|
|
|
|
|
2010-03-27 15:26:36 +01:00
|
|
|
#include <cstdlib>
|
|
|
|
|
|
2010-03-24 05:00:06 +01:00
|
|
|
//using mobject::Session;
|
|
|
|
|
//using mobject::MObject;
|
|
|
|
|
|
|
|
|
|
using lib::Symbol;
|
|
|
|
|
//using util::isnil;
|
|
|
|
|
//using util::contains;
|
|
|
|
|
//using asset::Query;
|
|
|
|
|
//using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY;
|
|
|
|
|
//using lumiera::query::extractID;
|
|
|
|
|
|
2010-03-29 03:27:47 +02:00
|
|
|
namespace mobject {
|
|
|
|
|
namespace session {
|
|
|
|
|
|
|
|
|
|
class Track;
|
|
|
|
|
class Clip;
|
|
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
2010-03-24 05:00:06 +01:00
|
|
|
namespace asset{
|
|
|
|
|
|
|
|
|
|
class Track;
|
|
|
|
|
class Pipe;
|
|
|
|
|
class ProcPatt;
|
|
|
|
|
class Timeline;
|
|
|
|
|
class Sequence;
|
|
|
|
|
|
|
|
|
|
namespace idi {
|
2010-03-29 03:27:47 +02:00
|
|
|
|
2010-03-24 05:00:06 +01:00
|
|
|
// structural asset ID scheme ///////////////////////////////////////////////////////////TICKET #565
|
|
|
|
|
|
|
|
|
|
template<class STRU>
|
|
|
|
|
struct StructTraits
|
|
|
|
|
{
|
|
|
|
|
static Symbol namePrefix;
|
|
|
|
|
static Symbol catFolder;
|
|
|
|
|
static Symbol idSymbol;
|
|
|
|
|
};
|
|
|
|
|
|
2010-04-09 03:45:20 +02:00
|
|
|
// Note: individual defaults are defined in stuct.cpp
|
2010-03-29 03:27:47 +02:00
|
|
|
|
2010-03-24 05:00:06 +01:00
|
|
|
|
2010-03-27 15:26:36 +01:00
|
|
|
/* catch-all defaults */
|
|
|
|
|
template<class X>
|
2010-03-27 16:26:22 +01:00
|
|
|
Symbol StructTraits<X>::idSymbol = typeid(X).name(); ////////////////////TICKET #583 this default works but is ugly
|
2010-03-27 15:26:36 +01:00
|
|
|
template<class X>
|
2010-03-27 16:26:22 +01:00
|
|
|
Symbol StructTraits<X>::catFolder = StructTraits<X>::idSymbol;
|
2010-03-27 15:26:36 +01:00
|
|
|
template<class X>
|
2010-03-27 16:26:22 +01:00
|
|
|
Symbol StructTraits<X>::namePrefix = StructTraits<X>::idSymbol;
|
2010-03-27 15:26:36 +01:00
|
|
|
|
2010-03-24 05:00:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class STRU>
|
|
|
|
|
inline string
|
|
|
|
|
generateSymbolID()
|
|
|
|
|
{
|
|
|
|
|
static uint i=0;
|
2010-03-29 03:27:47 +02:00
|
|
|
static format namePattern ("%s.%03d");
|
2010-03-24 05:00:06 +01:00
|
|
|
/////////////////////////////////////////////////////////TODO needs to be pushed down into a *.cpp
|
|
|
|
|
|
|
|
|
|
return str(namePattern % StructTraits<STRU>::namePrefix % (++i) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace asset::idi
|
|
|
|
|
#endif
|