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


C++ PSLAP_OBJ_MAPPER_OBJECT::GetObjBroker方法代码示例

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


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

示例1: AnscDelTokenChain

ANSC_STATUS
SlapOmoDelObjEntity
    (
        ANSC_HANDLE                 hThisObject,
        char*                       path,
        BOOL                        bFreeObjEntity
    )
{
    ANSC_STATUS                     returnStatus    = ANSC_STATUS_SUCCESS;
    PSLAP_OBJ_MAPPER_OBJECT         pMyObject       = (PSLAP_OBJ_MAPPER_OBJECT  )hThisObject;
    PSLAP_OBJ_MAPPER_PROPERTY       pProperty       = (PSLAP_OBJ_MAPPER_PROPERTY)&pMyObject->Property;
    PSLAP_OBJ_BROKER_OBJECT         pRootObjBroker  = (PSLAP_OBJ_BROKER_OBJECT  )pMyObject->hRootObjBroker;
    PSLAP_OBJ_ENTITY_OBJECT         pObjEntity      = NULL;
    PSLAP_OBJ_BROKER_OBJECT         pThisObjBroker  = NULL;
    PSLAP_OBJ_BROKER_OBJECT         pNextObjBroker  = NULL;
    PANSC_TOKEN_CHAIN               pPathTokenChain = NULL;
    PANSC_STRING_TOKEN              pPathToken      = NULL;

    pPathTokenChain = (PANSC_TOKEN_CHAIN)AnscAllocateMemory(sizeof(ANSC_TOKEN_CHAIN));

    if ( !pPathTokenChain )
    {
        return  ANSC_STATUS_RESOURCES;
    }
    else
    {
        returnStatus =
            AnscSetTokenChain
                (
                    (ANSC_HANDLE)pPathTokenChain,
                    path,
                    SLAP_OBJ_PATH_SEPARATORS
                );
    }

    if ( returnStatus != ANSC_STATUS_SUCCESS )
    {
        AnscDelTokenChain((ANSC_HANDLE)pPathTokenChain);
        AnscFreeMemory   ((ANSC_HANDLE)pPathTokenChain);

        return  returnStatus;
    }
    else
    {
        pThisObjBroker =
            (PSLAP_OBJ_BROKER_OBJECT)pMyObject->GetObjBroker
                (
                    (ANSC_HANDLE)pMyObject,
                    (ANSC_HANDLE)pPathTokenChain
                );

        AnscDelTokenChain((ANSC_HANDLE)pPathTokenChain);
        AnscFreeMemory   ((ANSC_HANDLE)pPathTokenChain);
    }

    if ( pThisObjBroker )
    {
        pObjEntity = (PSLAP_OBJ_ENTITY_OBJECT)pThisObjBroker->hSlapObjEntity;

        if ( pObjEntity )
        {
            pThisObjBroker->hSlapObjEntity = (ANSC_HANDLE)NULL;

            if ( bFreeObjEntity )
            {
                pObjEntity->Remove((ANSC_HANDLE)pObjEntity);
            }
        }
    }
    else
    {
        return  ANSC_STATUS_CANT_FIND;
    }

    /*
     * After removing the associated Obj Entity Object, the Obj Broker Object may have become
     * removeable if there's no more Broker Objects currently associated with it. We shall trim all
     * the unnecessary branches from the bottom to the top.
     */
    while ( pThisObjBroker && (pThisObjBroker != pRootObjBroker) && pThisObjBroker->IsRemoveable((ANSC_HANDLE)pThisObjBroker) )
    {
        pNextObjBroker = pThisObjBroker;
        pThisObjBroker = (PSLAP_OBJ_BROKER_OBJECT)pNextObjBroker->hOwnerContext;
        returnStatus   =
            pThisObjBroker->DelObjBroker
                (
                    (ANSC_HANDLE)pThisObjBroker,
                    pNextObjBroker->PathName
                );
    }

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:93,代码来源:slap_omo_management.c


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