00001 /* 00002 * Copyright 2006 Sony Computer Entertainment Inc. 00003 * 00004 * Licensed under the MIT Open Source License, for details please see license.txt or the website 00005 * http://www.opensource.org/licenses/mit-license.php 00006 * 00007 */ 00008 00009 #ifndef __DAE_META_CM_POLICY_H__ 00010 #define __DAE_META_CM_POLICY_H__ 00011 00012 #include <dae/daeTypes.h> 00013 #include <dae/daeElement.h> 00014 //class daeElement; 00015 class daeMetaElement; 00016 00021 class daeMetaCMPolicy 00022 { 00023 public: 00037 virtual daeElement *placeElement( daeElement *parent, daeElement *child, daeUInt &ordinal, daeInt offset = 0, daeElement* before = NULL, daeElement *after = NULL ) = 0; 00045 virtual daeBool removeElement(daeElement* parent, daeElement* child ) = 0; 00052 virtual daeMetaElement *findChild( daeString elementName ) = 0; 00058 virtual void getChildren( daeElement* parent, daeElementRefArray &array ) = 0; 00059 00064 void appendChild( daeMetaCMPolicy *p ) { _children.append( p ); } 00065 00070 daeMetaCMPolicy *getParent() { return _parent; } 00071 00077 void setMaxOrdinal( daeUInt ord ) { _maxOrdinal = ord; } 00078 00079 protected: 00089 daeMetaCMPolicy( daeMetaElement *container ,daeMetaCMPolicy *parent, daeUInt ordinal, 00090 daeInt minO, daeInt maxO ) : _container( container ), _parent( parent ), _minOccurs( minO ), 00091 _maxOccurs( maxO ), _maxOrdinal( 0 ), _ordinalOffset( ordinal ) {} 00092 00093 public: 00097 virtual ~daeMetaCMPolicy(); 00098 00099 protected: 00100 daeMetaElement * _container; 00101 daeMetaCMPolicy * _parent; 00102 daeTArray<daeMetaCMPolicy*> _children; 00103 00105 daeInt _minOccurs; 00107 daeInt _maxOccurs; 00108 00109 daeUInt _maxOrdinal; 00110 daeUInt _ordinalOffset; 00111 00112 }; 00113 00114 #endif 00115