本文整理汇总了C++中CKBehavior::CreateInputParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ CKBehavior::CreateInputParameter方法的具体用法?C++ CKBehavior::CreateInputParameter怎么用?C++ CKBehavior::CreateInputParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKBehavior
的用法示例。
在下文中一共展示了CKBehavior::CreateInputParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CISIteratorCB
/*
*******************************************************************
* Function: int CISIteratorCB( const CKBehaviorContext& behaviorContext )
*
* Description : The Behavior Callback function is called by Virtools when various events happen
* in the life of a BuildingBlock. Exactly which events trigger a call to the
* Behavior Callback function is defined in the Behavior Prototype, along with the
* declaration of the function pointer
*
* Parameters :
* behaviourContext r Behavior context reference, which gives
* access to frequently used global objects
* ( context, level, manager, etc... )
*
* Returns : int, The return value of the callback function should be one of the CK_BEHAVIOR_RETURN values.
*
*******************************************************************
*/
CKERROR CISIteratorCB(const CKBehaviorContext& behcontext)
{
/************************************************************************/
/* collecting data : */
/* */
CKBehavior *beh = behcontext.Behavior;
CKContext* ctx = beh->GetCKContext();
CKParameterManager *pm = static_cast<CKParameterManager*>(ctx->GetParameterManager());
CGBLCIConfigurationController* cman=(CGBLCIConfigurationController*)ctx->GetManagerByGuid(CONFIGURATION_MAN_GUID);
/************************************************************************/
/* process virtools callbacks : */
/* */
switch(behcontext.CallbackMessage)
{
case CKM_BEHAVIORRESET:
{
CKDataArray *array = NULL;
beh->SetLocalParameterValue(BEH_LOCAL_PAR_INDEX_CIID_LIST,&array);
break;
}
case CKM_BEHAVIOREDITED:
case CKM_BEHAVIORSETTINGSEDITED :
{
assert(beh && ctx);
BOOL getFromDB = false;
beh->GetLocalParameterValue(BEH_LOCAL_PAR_INDEX_DB_MODE,&getFromDB);
if( getFromDB && ( beh->GetInputParameterCount() == BEH_IN_INDEX_MIN_COUNT ) )
{
beh->CreateInputParameter("CIS ID", CKPGUID_INT);
}
//////////////////////////////////////////////////////////////////////////
//remove all pIns :
int p_count = beh->GetInputParameterCount();
while( (getFromDB ? BEH_IN_INDEX_MAX_COUNT : BEH_IN_INDEX_MIN_COUNT ) < p_count )
{
CKDestroyObject( beh->RemoveInputParameter( --p_count) );
}
break;
}
}
return CKBR_OK;
}