Main Page | File List | Globals | Related Pages

k_constraints.h File Reference

Constraints Management Functions. More...

#include "iklaxlib_global.h"
#include "KFile.h"

Enumerations

enum  KConstValid { KCNST_VALID, KCNST_SEMIVALID, KCNST_INVALID, KCNST_ERROR }

Functions

KL_API KBool k_addExclu (KFile *pKFile, KCString sConsttName, KCString sEltName1, KCString sEltName2)
 Creates an exclusion constraint in a KFile structure.
KL_API KBool k_addNotMute (KFile *pKFile, KCString sConsttName, KCString sEltName)
 Creates a not mute constraint in a KFile structure.
KL_API KBool k_addImply (KFile *pKFile, KCString sConsttName, KCString sImplyingName, KCString sImpliedName)
 Creates an implication constraint in a KFile structure.
KL_API KCString k_getImplyingElt (KFile *pKFile, KCString sConsttName)
 Returns the implying element of an implication constraint.
KL_API KBool k_addEquiv (KFile *pKFile, KCString sConsttName)
 Creates an equivalence mixing rule in a KFile structure.
KL_API KBool k_addGroup (KFile *pKFile, KCString sGroupName)
 Creates a group in a KFile structure.
KL_API KBool k_setGroupMinMax (KFile *pKFile, KCString sGroupName, const KUInt32 iMin, const KUInt32 iMax)
 Sets a Min-Max constraint on a group.
KL_API KBool k_getGroupMinMax (KFile *pKFile, KCString sGroupName, KUInt32 *pMin, KUInt32 *pMax)
 Gets the Min-Max values of a group.
KL_API KBool k_setLevelLimits (KFile *pKFile, KCString sEltName, const KLevel dMin, const KLevel dMax)
 Sets limits mixing constraint to an element.
KL_API KBool k_getLevelLimits (KFile *pKFile, KCString sEltName, KLevel *pMin, KLevel *pMax)
 Gets limits values of an element.
KL_API KBool k_addGroupSubElt (KFile *pKFile, KCString sGroupName, KCString sChildName)
 Adds a sub-element to a group in a KFile structure.
KL_API KBool k_remSubElt (KFile *pKFile, KCString sParentName, KCString sChildName)
 Removes a sub-element from an element.
KL_API KBool k_addSubElt (KFile *pKFile, KCString sParent, KCString sChild)
 Adds a sub-element to an element in a KFile structure.
KL_API KConstValid k_checkSelectConstraint (KFile *pKFile)
 Checks if selection constraints are coherent.
KL_API KConstValid k_checkMixingConstraint (KFile *pKFile)
 Checks if mixing constraints are coherent.


Detailed Description

Constraints Management Functions.

Version:
iKlaxLib-1.5
Author:
Fabien Gallot
Date:
15/01/2010
See also:
This file has been developed with KToolLib.
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Enumeration Type Documentation

enum KConstValid
 

Enumeration values:
KCNST_VALID  Constraints are consistent.
KCNST_SEMIVALID  The constraints are partly consistent.

Only for selection constraints. This means that solutions can be found with some parameters, but one or more elements will never be played.

KCNST_INVALID  Constraints are inconsistent.

This means that no solution can be found.

KCNST_ERROR  Error during checking process.


Function Documentation

KL_API KBool k_addEquiv KFile pKFile,
KCString  sConsttName
 

Creates an equivalence mixing rule in a KFile structure.

Parameters:
pKFile a pointer to a valid KFile structure
sConsttName the new constraint name
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_addExclu KFile pKFile,
KCString  sConsttName,
KCString  sEltName1,
KCString  sEltName2
 

Creates an exclusion constraint in a KFile structure.

Parameters:
pKFile a pointer to a valid KFile structure
sConsttName the new constraint name
sEltName1 the name of the exclusion first element
sEltName2 the name of the exclusion second element
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_addGroup KFile pKFile,
KCString  sGroupName
 

Creates a group in a KFile structure.

Parameters:
pKFile a pointer to a valid KFile structure
sGroupName the new group name
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_addGroupSubElt KFile pKFile,
KCString  sGroupName,
KCString  sChildName
 

Adds a sub-element to a group in a KFile structure.

This function increases the 'Max' limit value of the group.

Parameters:
pKFile a pointer to a valid KFile structure
sGroupName the element name where sub-element should be added
sChildName the sub-element name to be added
Returns:
ktrue if successful otherwise kfalse

KL_API KBool k_addImply KFile pKFile,
KCString  sConsttName,
KCString  sImplyingName,
KCString  sImpliedName
 

Creates an implication constraint in a KFile structure.

KFile* pKFile;
// [...]
k_addImply (pKFile, "MyImplication", "A", "B");
This code creates an implication A -> B. It means that if "A" is playing, "B" is playing too. And if "B" is not playing, "A" isn't playing too.

Parameters:
pKFile a pointer to a valid KFile structure
sConsttName the name of the new constraint
sImplyingName the name of the implication implying element
sImpliedName the name of the implication implied element
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_addNotMute KFile pKFile,
KCString  sConsttName,
KCString  sEltName
 

Creates a not mute constraint in a KFile structure.

Parameters:
pKFile a pointer to a valid KFile structure
sConsttName the new constraint name
sEltName the name of the element to set in "not-mute"
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_addSubElt KFile pKFile,
KCString  sParent,
KCString  sChild
 

Adds a sub-element to an element in a KFile structure.

If the parent element is a group, this function doesn't increase the limits values.

Parameters:
pKFile the pointer to the KFile structure
sParent the element name where sub-element should be added
sChild the sub-element name to be added
Returns:
ktrue if successful otherwise kfalse

KL_API KConstValid k_checkMixingConstraint KFile pKFile  ) 
 

Checks if mixing constraints are coherent.

Parameters:
pKFile the pointer to the KFile structure
Returns:
a KConstValid value
See also:
KConstValid for more details

KL_API KConstValid k_checkSelectConstraint KFile pKFile  ) 
 

Checks if selection constraints are coherent.

Parameters:
pKFile the pointer to the KFile structure
Returns:
a KConstValid value
See also:
KConstValid for more details

KL_API KBool k_getGroupMinMax KFile pKFile,
KCString  sGroupName,
KUInt32 *  pMin,
KUInt32 *  pMax
 

Gets the Min-Max values of a group.

Parameters:
pKFile a pointer to a valid KFile structure
sGroupName the group name
pMin a pointer to a 32 bits-unsigned integer which will contain the minimum number of group elements which can play simultaneous
pMax a pointer to a 32 bits-unsigned integer which will contain the maximum number of group elements which can play simultaneous
Returns:
ktrue if no error, otherwise kfalse

KL_API KCString k_getImplyingElt KFile pKFile,
KCString  sConsttName
 

Returns the implying element of an implication constraint.

Parameters:
pKFile a pointer to a valid KFile structure
sConsttName the implication name
Returns:
the implying element of the implication constraint or knull if an error appends.

KL_API KBool k_getLevelLimits KFile pKFile,
KCString  sEltName,
KLevel pMin,
KLevel pMax
 

Gets limits values of an element.

Parameters:
pKFile a pointer to a valid KFile structure
sEltName a element name
pMin a pointer to a KLevel value will contain the limit minimum value
pMax a pointer to a KLevel value will contain the limit maximum value
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_remSubElt KFile pKFile,
KCString  sParentName,
KCString  sChildName
 

Removes a sub-element from an element.

Parameters:
pKFile a pointer to a valid KFile structure
sParentName the parent element name
sChildName the element name to remove
Returns:
ktrue if successful otherwise kfalse

KL_API KBool k_setGroupMinMax KFile pKFile,
KCString  sGroupName,
const KUInt32  iMin,
const KUInt32  iMax
 

Sets a Min-Max constraint on a group.

Parameters:
pKFile a pointer to a valid KFile structure
sGroupName the group name
iMin the minimum number of group elements which can play simultaneous
iMax the maximum number of group elements which can play simultaneous
Returns:
ktrue if no error, otherwise kfalse

KL_API KBool k_setLevelLimits KFile pKFile,
KCString  sEltName,
const KLevel  dMin,
const KLevel  dMax
 

Sets limits mixing constraint to an element.

Parameters:
pKFile a pointer to a valid KFile structure
sEltName a element name
dMin the limit minimum value
dMax the limit maximum value
Returns:
ktrue if no error, otherwise kfalse


Generated on Tue Mar 9 11:45:47 2010 for iKlax Library (iKlaxLib) by doxygen 1.3.8