1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #include <dae.h> 10 #include <dae/daeDom.h> 11 #include <dom/domInputLocal.h> 12 #include <dae/daeMetaCMPolicy.h> 13 #include <dae/daeMetaSequence.h> 14 #include <dae/daeMetaChoice.h> 15 #include <dae/daeMetaGroup.h> 16 #include <dae/daeMetaAny.h> 17 #include <dae/daeMetaElementAttribute.h> 18 19 daeElementRef create(DAE & dae)20domInputLocal::create(DAE& dae) 21 { 22 domInputLocalRef ref = new domInputLocal(dae); 23 return ref; 24 } 25 26 27 daeMetaElement * registerElement(DAE & dae)28domInputLocal::registerElement(DAE& dae) 29 { 30 daeMetaElement* meta = dae.getMeta(ID()); 31 if ( meta != NULL ) return meta; 32 33 meta = new daeMetaElement(dae); 34 dae.setMeta(ID(), *meta); 35 meta->setName( "InputLocal" ); 36 meta->registerClass(domInputLocal::create); 37 38 39 // Add attribute: semantic 40 { 41 daeMetaAttribute *ma = new daeMetaAttribute; 42 ma->setName( "semantic" ); 43 ma->setType( dae.getAtomicTypes().get("xsNMTOKEN")); 44 ma->setOffset( daeOffsetOf( domInputLocal , attrSemantic )); 45 ma->setContainer( meta ); 46 ma->setIsRequired( true ); 47 48 meta->appendAttribute(ma); 49 } 50 51 // Add attribute: source 52 { 53 daeMetaAttribute *ma = new daeMetaAttribute; 54 ma->setName( "source" ); 55 ma->setType( dae.getAtomicTypes().get("URIFragmentType")); 56 ma->setOffset( daeOffsetOf( domInputLocal , attrSource )); 57 ma->setContainer( meta ); 58 ma->setIsRequired( true ); 59 60 meta->appendAttribute(ma); 61 } 62 63 meta->setElementSize(sizeof(domInputLocal)); 64 meta->validate(); 65 66 return meta; 67 } 68 69