コード例 #1
0
 SlicedArrayImpl::SlicedArrayImpl( std::string const &codeName, RC::ConstHandle<Impl> const &memberImpl )
   : ArrayImpl( codeName, DT_SLICED_ARRAY, memberImpl )
   , m_memberImpl( memberImpl )
   , m_memberSize( memberImpl->getAllocSize() )
   , m_variableArrayImpl( memberImpl->getVariableArrayImpl() )
 {
   setSize( sizeof(bits_t) );
 }
コード例 #2
0
ファイル: DictImpl.cpp プロジェクト: EgoIncarnate/fe-devel
 DictImpl::DictImpl(
   std::string const &codeName,
   RC::ConstHandle<ComparableImpl> const &keyImpl,
   RC::ConstHandle<Impl> const &valueImpl
   )
   : m_keyImpl( keyImpl )
   , m_keySize( keyImpl->getAllocSize() )
   , m_valueImpl( valueImpl )
   , m_valueSize( valueImpl->getAllocSize() )
   , m_nodeSize( sizeof(node_t) + m_keySize + m_valueSize )
 {
   size_t flags = 0;
   if ( keyImpl->isNoAliasUnsafe() || valueImpl->isNoAliasUnsafe() )
     flags |= FlagNoAliasUnsafe;
   if ( m_keyImpl->isExportable() && m_valueImpl->isExportable() )
     flags |= FlagExportable;
   initialize( codeName, DT_DICT, sizeof(bits_t *), flags );
 }
コード例 #3
0
 void ArrayProducer::ComputeState::produceJSON( size_t index, JSON::Encoder &jg ) const
 {
   RC::ConstHandle<RT::Desc> elementDesc = m_arrayProducer->getElementDesc();
   
   size_t allocSize = elementDesc->getAllocSize();
   void *valueData = alloca( allocSize );
   memset( valueData, 0, allocSize );
   produce( index, valueData );
   elementDesc->encodeJSON( valueData, jg );
   elementDesc->disposeData( valueData );
 }
コード例 #4
0
 void ArrayProducer::ComputeState::produceJSON( size_t index, size_t count, JSON::Encoder &jg ) const
 {
   RC::ConstHandle<RT::Desc> elementDesc = m_arrayProducer->getElementDesc();
   size_t allocSize = elementDesc->getAllocSize();
   size_t totalAllocSize = allocSize * count;
   void *datas = alloca( totalAllocSize );
   memset( datas, 0, totalAllocSize );
   produce( index, count, datas );
   {
     JSON::ArrayEncoder jag = jg.makeArray();
     uint8_t *data = reinterpret_cast<uint8_t *>( datas );
     for ( size_t i=0; i<count; ++i )
     {
       JSON::Encoder elementEncoder = jag.makeElement();
       elementDesc->encodeJSON( data, elementEncoder );
       data += allocSize;
     }
   }
   elementDesc->disposeDatas( datas, count, allocSize );
 }
コード例 #5
0
ファイル: OpaqueImpl.cpp プロジェクト: EgoIncarnate/fe-devel
bool OpaqueImpl::isEquivalentTo( RC::ConstHandle<Impl> const &impl ) const
{
    if ( !isOpaque( impl->getType() ) )
        return false;
    return getAllocSize() == impl->getAllocSize();
}