当前位置: 首页>>代码示例>>C++>>正文


C++ Attachment::getGroupId方法代码示例

本文整理汇总了C++中Attachment::getGroupId方法的典型用法代码示例。如果您正苦于以下问题:C++ Attachment::getGroupId方法的具体用法?C++ Attachment::getGroupId怎么用?C++ Attachment::getGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attachment的用法示例。


在下文中一共展示了Attachment::getGroupId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void FieldTraits<AttachmentMap>::copyFromBin(BinaryDataHandler &pMem,
                                             AttachmentMap     &aMap )
{
    Attachment *attPtr;
    UInt32      key;
    UInt16      binding;
    UInt32      fcId;
    UInt32      size;
        
    pMem.getValue(size);


    AttachmentMap::const_iterator mapIt  = aMap.begin();
    AttachmentMap::const_iterator mapEnd = aMap.end  ();

    for(; mapIt != mapEnd; ++mapIt)
    {
        if((*mapIt).second != NULL)
        {
            Thread::getCurrentChangeList()->addDelayedSubRef<
            UnrecordedRefCountPolicy>((*mapIt).second);
        }
    }
        
    aMap.clear();

        
    for(UInt32 i = 0; i < size; ++i)
    {
        pMem.getValue(binding);
        pMem.getValue(fcId   );
        
        attPtr = dynamic_cast<Attachment *>(
            FieldContainerFactory::the()->getMappedContainer(fcId));

        if(attPtr != NULL)
        {
            key = (static_cast<UInt32>(attPtr->getGroupId()) << 16) | binding;

            UnrecordedRefCountPolicy::addRef(attPtr);

            aMap.insert(AttachmentMap::value_type(key, attPtr));
        }
    }
}
开发者ID:DaveHarrison,项目名称:OpenSGDevMaster,代码行数:45,代码来源:OSGAttachmentMapFields.cpp

示例2: copyFromBin

void AttachmentContainer::copyFromBin(BinaryDataHandler &pMem, 
                                      ConstFieldMaskArg  whichField)
{
    Inherited::copyFromBin(pMem, whichField);

    if(FieldBits::NoField != (AttachmentsFieldMask & whichField))
    {
        // _sfAttachments.copyFromBin(pMem);

        editSField(AttachmentsFieldMask);

        UInt32 size;

        pMem.getValue(size);

        AttachmentMap::const_iterator mapIt  = _sfAttachments.getValue().begin();
        AttachmentMap::const_iterator mapEnd = _sfAttachments.getValue().end  ();

        for(; mapIt != mapEnd; ++mapIt)
        {
            if((*mapIt).second != NULL)
            {
                if(this->isMTLocal())
                {
                    Thread::getCurrentChangeList()->addDelayedSubRef<
                        RecordedRefCountPolicy>((*mapIt).second);
                }
                else
                {
                    Thread::getCurrentChangeList()->addDelayedSubRef<
                        UnrecordedRefCountPolicy>((*mapIt).second);
                }
            }
        }

        _sfAttachments.getValue().clear();

        for(UInt32 i = 0; i < size; ++i)
        {
            UInt16 binding;
            UInt32 fcId;

            pMem.getValue(binding);
            pMem.getValue(fcId   );

            Attachment *att = dynamic_cast<Attachment *>(
                FieldContainerFactory::the()->getMappedContainer(fcId));

            if(att != NULL)
            {
                UInt32 key = (static_cast<UInt32>(att->getGroupId()) << 16) | binding;

                if(this->isMTLocal())
                {
                    RecordedRefCountPolicy::addRef(att);
                }
                else
                {
                    UnrecordedRefCountPolicy::addRef(att);
                }

                _sfAttachments.getValue().insert(
                    AttachmentMap::value_type(key, att));
            }
        }
    }
}
开发者ID:vossg,项目名称:OpenSGDevMaster,代码行数:67,代码来源:OSGAttachmentContainer.cpp


注:本文中的Attachment::getGroupId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。