All Categories Class Hierarchy This Category Previous Next Indexes
Product Class CATPSNInstanceManagement
CATPSNInstanceManagement
public class CATPSNInstanceManagement
Note:
Following convention is used for naming parameters: parameter names prefixed by:
- i are input parameters
- o are ouput parameters
- io are input/output parameters
Method Index
- o
DeleteInstance(ObjID,double*,int&,char*)
- Allows the user to remove an instance from the database
It is the responsibility of the user to check that the links passed
in an array as parameters exist in the database.
- o
EndTransaction()
- End a transaction :
RemoveInstance / WriteInstance has not been committed
during the transaction.
- o
GetInstanceAttList(char*,char***,int&)
- Returns the list of attributes that can be valuated in an instance
insertion or modification operations.
- o
ReadInstanceAttValues(ObjID,double*,int&,char**,int&,char***,int&)
- Allows reading of attribute values of an instance in the database.
- o
SelectInstanceOnAttValues(char*,char**,int&,char**,int&,ObjID**,int&)
- Allows the user to make requests on the attribute values.
- o
StartTransaction()
- Start a transaction :
RemoveInstance / WriteInstance will not commit
during the transaction
- o
UpdateInstanceInDB(char*,char*,char*,char**,int&,char**,int&)
- Update an instance of PART_PTR in the database
The commit/rollback must be done using CATDMUsrConnection::Commit()
or CATDMUsrConnection::Rollback()
- o
WriteInstance(ObjID,char*,double*,int&,char**,int&,char**,int&,ObjID*)
- Allows creation of an instance in the database.
Methods
o DeleteInstance
| public static Error DeleteInstance( | ObjID | iRootPart, |
| double* | iCLinkArray, |
| int& | iNbCLinks, |
| char* | iUsedColName | ="C_USED_ASSY") |
-
Allows the user to remove an instance from the database
It is the responsibility of the user to check that the links passed
in an array as parameters exist in the database.
- Parameters:
-
- iRootPart
- Object corresponding to the root on which the instance is defined.
- iCLinkArray
- List of links defining the instance with relation to the root object.
- iNbCLinks
- Number of links in the previous list.
- iUsedColName
- Kind of use for which the instance is not needed any more.
This parameter must received a not NULL value.
If the instance is not used anymore, it is deleted from database.
- Clash instance: C_USED_CLASH
- Assembly instance: C_USED_ASSY
- Returns:
- An error object
o EndTransaction
| public static void EndTransaction( | ) |
-
End a transaction :
RemoveInstance / WriteInstance has not been committed
during the transaction.
After ending the transaction, Commit/Rollback should be done.
The commit/rollback must be done using CATDMUsrConnection::Commit()
or CATDMUsrConnection::Rollback()
o GetInstanceAttList
| public static Error GetInstanceAttList( | char* | iEnvironment, |
| char*** | oAttributeList, |
| int& | oNbAttribs) |
-
Returns the list of attributes that can be valuated in an instance
insertion or modification operations. Result of this function is based
on the content of the profile line GLOBAL_$INSERTS_PART_PTR.
Desallocation is the responsability of the user.
- Parameters:
-
- iEnvironment
- Database environment on which the available instance attributes must be read.
- oAttributeList
- List of attributes that are available for instance definition and modification.
- oNbAttribs
- Number of attributes returned in the previous list.
- Returns:
- An error object
o ReadInstanceAttValues
| public static Error ReadInstanceAttValues( | ObjID | iRootPart, |
| double* | iCLinkArray, |
| int& | iNbCLinks, |
| char** | iAttribList, |
| int& | iNbAttribs, |
| char*** | oValueList, |
| int& | oNbValues) |
-
Allows reading of attribute values of an instance in the database.
Desallocation is the responsability of the user.
- Parameters:
-
- iRootPart
- Object corresponding to the root on which the instance is defined.
- iCLinkArray
- List of links defining the instance with relation to the root object.
- iNbCLinks
- Number of links in the previous list.
- iAttribList
- List of attributes values of which will be retrieved from the database.
- iNbAttribs
- Number of attributes in the previous list.
- oValueList
- List of values corresponding respectively to the list of attributes to be read.
- oNbValues
- Number of values in the returned list. This should of course be equal to iNbAttribs.
- Returns:
- An error object
o SelectInstanceOnAttValues
| public static Error SelectInstanceOnAttValues( | char* | iEnvironment, |
| char** | iAttribList, |
| int& | iNbAttribs, |
| char** | iValueList, |
| int& | iNbValues, |
| ObjID** | oResultInstList, |
| int& | oNbResults) |
-
Allows the user to make requests on the attribute values.
Desallocation is the responsability of the user.
- Parameters:
-
- iEnvironment
- Database environment on which the query must be applied.
- iAttribList
- List of attributes on which the query will be made.
- iNbAttribs
- Number of attributes in the previous list.
- iValueList
- List of values on which the request must be done. These must correspond to the attributes list.
- iNbValues
- Number of values in the previous list. This parameter must be equal to iNbAttribs, but it is
asked as a parameter in order to keep a coherent parameters list.
- oResultInstList
- List of instance that is returned by the query.
- oNbResults
- Number of instances retrieved by the query. This is equivalent to the size of the previous parameter.
- Returns:
- An error object
o StartTransaction
| public static void StartTransaction( | ) |
-
Start a transaction :
RemoveInstance / WriteInstance will not commit
during the transaction
o UpdateInstanceInDB
| public static Error UpdateInstanceInDB( | char* | iCoid, |
| char* | iCompid, |
| char* | iEnvironment, |
| char** | iAttribList, |
| int& | iNbAttribs, |
| char** | iValueList, |
| int& | iNbValues) |
-
Update an instance of PART_PTR in the database
The commit/rollback must be done using CATDMUsrConnection::Commit()
or CATDMUsrConnection::Rollback()
- Parameters:
-
- iCoid
- Coid of the root instance.
- iCompid
- Compid of the instance.
- iEnvironment
- Environment of the instance.
- iAttribList
- List of attributes that will receive a value when writing the instance.
- iNbAttribs
- Number of attributes in the previous list.
- iValueList
- List of values that will be affected to the corresponding attributes.
- iNbValues
- Number of values in the previous list.
This parameter must be the same as iNbAttribs.
It is added here in order to keep a coherence in the parameters list.
- Returns:
- An error object
o WriteInstance
| public static Error WriteInstance( | ObjID | iRootPart, |
| char* | iUsedColName, |
| double* | iCLinkArray, |
| int& | iNbCLinks, |
| char** | iAttribList, |
| int& | iNbAttribs, |
| char** | iValueList, |
| int& | iNbValues, |
| ObjID* | oCreatedInstance) |
-
Allows creation of an instance in the database.
If the Instance already exist, it is updated.
It is the responsibility of the user to check that the links passed
in an array as parameters exist in the database.
- Parameters:
-
- iRootPart
- Root part of the PSN tree on which the instance will be defined.
This part should be agreed on and stay the same for the whole project.
- iUsedColName
- Name of the database column that must receive a value in order to
indicate the use of an instance.
- Clash instance: C_USED_CLASH
- Assembly instance: C_USED_ASSY
- iCLinkArray
- Array of links COMPIDs that describe the position in the PSN tree of the node
the instance will be created on.
- iNbCLinks
- Number of links in the previous array.
- iAttribList
- List of attributes that will receive a value when writing the instance.
- iNbAttribs
- Number of attributes in the previous list.
- iValueList
- List of values that will be affected to the corresponding attributes.
- iNbValues
- Number of values in the previous list.
This parameter must be the same as iNbAttribs.
It is added here in order to keep a coherence in the parameters list.
- oCreatedInstance
- Definition of the instance that has just been created.
This object contains the complete description of the location of the
instance in the database.
- Returns:
- An error object
This object is included in the file: CATPSNInstanceManagement.h
If needed, your Imakefile.mk should include the module: LV011ASS