Example #1
0
ConstArray::ConstArray(
    RC::ConstHandle<RT::Manager> const &rtManager,
    RC::ConstHandle<RT::ArrayDesc> const &arrayDesc,
    void const *data
)
{

    RC::ConstHandle<RT::Desc> elementDesc = arrayDesc->getMemberDesc();
    size_t count = arrayDesc->getNumMembers( data );

    m_fixedArrayDesc = rtManager->getFixedArrayOf( elementDesc, count );
    m_data.resize( m_fixedArrayDesc->getAllocSize(), 0 );
    for ( size_t i=0; i<count; ++i )
        elementDesc->setData( arrayDesc->getImmutableMemberData( data, i ), m_fixedArrayDesc->getMutableMemberData( &m_data[0], i ) );
}
Example #2
0
 size_t getFabricResourceDataSize( RC::ConstHandle<RT::StructDesc> const &desc, RC::ConstHandle<RT::VariableArrayDesc> const &dataMemberDesc, const void* resource )
 {
   return dataMemberDesc->getImpl()->getNumMembers( desc->getImmutableMemberData( resource, FABRIC_RESOURCE_DATA_MEMBER_INDEX ) );
 }