56 typedef TRAITS traits_type;
58 typedef typename TRAITS::value_type value_type;
65 return TRAITS::interpretation();
71 static bool matches(
const AbcA::MetaData &iMetaData,
72 SchemaInterpMatching iMatching = kStrictMatching )
74 return ( iMetaData.get(
"interpretation" ) ==
81 static bool matches(
const AbcA::PropertyHeader &iHeader,
82 SchemaInterpMatching iMatching = kStrictMatching )
84 return ( iHeader.getDataType().getPod() ==
85 TRAITS::dataType().getPod() &&
86 ( iHeader.getDataType().getExtent() ==
87 TRAITS::dataType().getExtent() ||
90 matches( iHeader.getMetaData(), iMatching );
106 AbcA::CompoundPropertyWriterPtr iParent,
107 const std::string &iName,
114 init( iParent, iName, iArg0, iArg1, iArg2, iArg3 );
122 const std::string &iName,
128 init( iParent.
getPtr(), iName, GetErrorHandlerPolicy( iParent ),
129 iArg0, iArg1, iArg2 );
135 AbcA::ArrayPropertyWriterPtr iProp,
139 GetErrorHandlerPolicy( iProp, iArg0, iArg1 ) )
141 init( iProp, iArg0, iArg1 );
147 AbcA::ArrayPropertyWriterPtr iProp,
148 WrapExistingFlag iWrapFlag,
152 GetErrorHandlerPolicy( iProp, iArg0, iArg1 ) )
154 init( iProp, iArg0, iArg1 );
163 void set(
const sample_type &iVal )
170 void init( AbcA::CompoundPropertyWriterPtr iParent,
171 const std::string &iName,
179 iArg0.setInto( args );
180 iArg1.setInto( args );
181 iArg2.setInto( args );
182 iArg3.setInto( args );
184 getErrorHandler().setPolicy( args.getErrorHandlerPolicy() );
186 ALEMBIC_ABC_SAFE_CALL_BEGIN(
"OTypedArrayProperty::init()" );
189 ABCA_ASSERT( iParent,
"NULL CompoundPropertyWriterPtr" );
192 AbcA::MetaData mdata = args.getMetaData();
199 AbcA::TimeSamplingPtr tsPtr = args.getTimeSampling();
200 uint32_t tsIndex = args.getTimeSamplingIndex();
207 tsIndex = iParent->getObject()->getArchive()->addTimeSampling(
211 m_property = iParent->createArrayProperty( iName, mdata,
212 TRAITS::dataType(), tsIndex );
214 ALEMBIC_ABC_SAFE_CALL_END_RESET();
217 void init( AbcA::ArrayPropertyWriterPtr iProp,
218 const Argument &iArg0,
const Argument &iArg1 )
220 ALEMBIC_ABC_SAFE_CALL_BEGIN(
221 "OTypedArrayProperty::init( ArrayPtr )" );
223 const AbcA::PropertyHeader &pheader = iProp->getHeader();
225 ABCA_ASSERT(
matches( pheader, GetSchemaInterpMatching( iArg0,iArg1 ) ),
226 "Incorrect match of header datatype: "
227 << pheader.getDataType()
229 << TRAITS::dataType()
230 <<
",\n...or incorrect match of interpretation: "
231 << pheader.getMetaData().get(
"interpretation" )
233 << TRAITS::interpretation() );
235 ALEMBIC_ABC_SAFE_CALL_END_RESET();
OTypedArrayProperty(AbcA::CompoundPropertyWriterPtr iParent, const std::string &iName, const Argument &iArg0=Argument(), const Argument &iArg1=Argument(), const Argument &iArg2=Argument(), const Argument &iArg3=Argument())
Definition OTypedArrayProperty.h:105
OTypedArrayProperty(OCompoundProperty iParent, const std::string &iName, const Argument &iArg0=Argument(), const Argument &iArg1=Argument(), const Argument &iArg2=Argument())
Definition OTypedArrayProperty.h:120