ProductStructureInterfaces Interface CATIPrdObject
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATIPrdObject
Interface to navigate on PLM typed features.
Role: This interface enables to navigate on PLM features in Instance<->Reference and Children to Parent
directions.
It is implemented by following PLM features :
- Product Instance & Product Reference
- Representation Instance
- Port
- Connection Instance & Connection Reference
However, for many of these features, some of these interface methods have no sense. Check the detailed return codes
documentation.
Refer to the Product Model technical article in the documentation for graphical explanations and definition of
used concepts such as context, searching direction, instance/reference, parent/child.
Method Index
- o
FindInstance(CATIPrdObject*,CATBaseUnknown*&,IID&)
- Retrieves a Product under a given context in the Instance to Reference direction.
- o
GetAllInstances(CATIPrdIterator*&,IID&)
- Retrieves all the Product Instances.
- o
GetAllInstancesInContexts(CATListValCATBaseUnknown_var*,CATIPrdIterator*&,IID&)
- Retrieves all the Product Instances under a list of given contexts.
- o
GetFatherProduct(CATBaseUnknown*&,IID&)
- Retrieves the parent Product.
- o
GetInstances(CATIPrdIterator*&,IID&)
- Retrieves the Product Instances located in the Reference to Instance path.
- o
GetReferenceObject(CATBaseUnknown*&,IID&)
- Retrieves the Reference object.
- o
GetRootFather(CATBaseUnknown*&,IID&)
- Retrieves the Root parent Product.
- o
IsAnInstanceOf(CATIPrdObject*)
- Checks whether the current Product is an instance of another given Product.
- o
IsReference()
- Checks whether the current object is a Reference object.
- o
IsRoot()
- Checks whether the current object is a Root object.
Methods
o FindInstance
public virtual FindInstance( | | iContext, |
| | oInstance, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves a Product under a given context in the Instance to Reference direction.
Role: This method searches the Product Instance of this's Reference Product aggregated under
a given context. The search starts from this Product among Products on the same Instance to Reference path,
in the Instance to Reference direction.
This means the context should match detailed location conditions, unless the method would fail in indetermination
case.
See the Product Model technical article for detailed and graphical documentation.
This method can be called either on a Product Reference or on a Product Instance, but it is not implemented
for any other kind of feature.
- Parameters:
-
- iContext
- The Product which should be a parent of the searched Product.
The method will fail in indetermination case if the context is not located in the right searching direction:
- if it belongs to the children of this's Product Reference or Product Instances.
- if it belongs to this's parents's Product Instances located on the Reference to Instance path.
It can be either a Reference Product or an Instance Product.
- oInstance
- [out, CATBaseUnknown#Release] The searched Product under the given context, in the right direction.
It can be, in particular cases:
- the context itself if iContext is one of this's Product Instances located on the
Instance to Reference path.
- this itself if iContext is one of this's parents,
or if iContext is equal to this.
- this's Product Reference if iContext is equal to this's Product Reference,
or if this is itself a Product Reference.
- iIID
- The interface IID to query on the returned object.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
- Example:
-
For example :
CATIPrdObject * pCurrentObject = ... ;
CATIPrdObject * pContext = ...;
CATBaseUnknown * pSearchedInstance = NULL;
if (SUCCEEDED(pCurrentObject->FindInstance(pContext, pSearchedInstance, IID_CATIMyInterface )))
{
CATIMyInterface * pMyInterfaceOnSearchedInstance = (CATIMyInterface *) pSearchedInstance;
...
pSearchedInstance->Release(); pSearchedInstance = NULL;
}
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The searched Product was successfully found.
- E_INVALIDARG
- iContext is not a valid pointer.
- E_NOTIMPL
- this is neither a Product Reference nor a Product Instance.
- E_FAIL
- No Product was founded in the given context or in case of undetermination.
o GetAllInstances
public virtual GetAllInstances( | | oInstances, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves all the Product Instances.
Role: This method creates an iterator managing all the Product Instances of this's Reference
Product.
See the Product Model technical article for detailed and graphical documentation.
This method can be called either on a Product Reference or on a Product Instance, but it is not implemented
by any other kind of feature.
- Parameters:
-
- oInstances
- [out, CATBaseUnknown#Release] The iterator managing all the Product Instances. Use its
method to iterate on the instances.
- iIID
- The interface IID to query on the objects managed by oInstances iterator.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
For example :
CATIPrdObject * pCurrentObject = ... ;
CATIPrdIterator * pIterator = NULL;
if (SUCCEEDED(pCurrentObject->GetAllInstances(pIterator, IID_CATIMyInterface )))
{
CATIMyInterface * pMyInterfaceOnInstance = NULL;
while (SUCCEEDED(pIterator->Next(pMyInterfaceOnInstance)))
{
...
pMyInterfaceOnInstance->Release(); pMyInterfaceOnInstance = NULL;
}
pIterator->Release(); pIterator = NULL;
}
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The iterator was successfully created.
- E_NOTIMPL
- this is neither a Product Reference nor a Product Instance.
- E_FAIL
- The iterator creation failed.
o GetAllInstancesInContexts
public virtual GetAllInstancesInContexts( | | iContexts, |
| | oInstances, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves all the Product Instances under a list of given contexts.
Role: This method creates an iterator managing all Product Instances of this's Product Reference.
Each of these Product Instance is aggregated by one of the given context.
See the Product Model technical article for detailed and graphical documentation.
This method can be called either on a Product Reference or on a Product Instance, but it is not implemented
for any other kind of feature.
- Parameters:
-
- iContexts
- The list of contexts.
Each context can be a Product Reference or a Product Instance.
- oInstances
- [out, CATBaseUnknown#Release] The iterator that owns the Product Instances. Use its
method to iterate on the instances.
- iIID
- The interface IID to query on the objects managed by the iterator.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
See
for an example of use.
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The iterator was successfully created.
- E_INVALIDARG
- The given contexts set is invalid.
- E_NOTIMPL
- this is neither a Product Reference nor a Product Instance.
- E_FAIL
- The iterator creation failed.
o GetFatherProduct
public virtual GetFatherProduct( | | oProduct, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves the parent Product.
Role: This method retrieves the aggregating Product of this object.
It can be called either on a Reference object or an Instance.
- Parameters:
-
- oProduct
- [out, CATBaseUnknown#Release] The parent Product.
- iIID
- The interface IID to query on the returned object.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
See
for an example of use.
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The parent Product was successfully retrieved.
- E_FAIL
- The calling object does not have any parent Product or an unexpected error occured.
o GetInstances
public virtual GetInstances( | | oInstances, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves the Product Instances located in the Reference to Instance path.
Role: This method creates an iterator managing the Product Instances located from this on the
Reference to Instance path.
See the Product Model technical article for detailed and graphical documentation.
This method can be called either on a Product Reference or on a Product Instance, but it is not implemented
for any other kind of feature.
- Parameters:
-
- oInstances
- [out, CATBaseUnknown#Release] The iterator managing the searched Product Instances. Use its
method to iterate on the instances.
- iIID
- The interface IID to query on the objects managed by oInstances iterator.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
See
for an example of use.
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The iterator was successfully created.
- E_NOTIMPL
- this is neither a Product Reference nor a Product Instance.
- E_FAIL
- The iterator creation failed.
o GetReferenceObject
public virtual GetReferenceObject( | | oReference, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves the Reference object.
Role: This method retrieves the Reference object of this object.
When called on a Reference object, it successfully retrieves itself.
- Parameters:
-
- oReference
- [out, CATBaseUnknown#Release] The Reference object.
- iIID
- The interface IID to query on the returned object.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
See
for an example of use.
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The Reference object was successfully retrieved.
- E_FAIL
- The Reference object was not successfully retrieved.
o GetRootFather
public virtual GetRootFather( | | oProduct, |
| const | iIID | = IID_CATIPrdObject) |
-
Retrieves the Root parent Product.
Role: This method retrieves the topmost aggregating Product of this object.
It can be called either on a Reference object or an Instance.
Particular case: when it is called on a Representation Instance, this method does the same as
- Parameters:
-
- oProduct
- [out, CATBaseUnknown#Release] The searched Root parent Product.
It will be this itself if this is not aggregated (if this is
a Product Reference for example)
It is equal to the parent Product when the method is called on a Representation Instance.
- iIID
- The interface IID to query on the returned object.
Legal values: It should be expressed as IID_CATIXX,
where CATIXX is the interface to which a pointer is requested (IID_CATIPrdObject by default)
See
for an example of use.
- Returns:
- An HRESULT value.
Legal values:
- S_OK
- The Root Product was successfully retrieved.
- E_FAIL
- The Root Product was not successfully retrieved.
o IsAnInstanceOf
public virtual IsAnInstanceOf( | | ipObject) |
-
Checks whether the current Product is an instance of another given Product.
Role: This method browses the Reference to Instance path, starting from the given Product and searches
for this Product.
This method can be called either on a Product Reference or on a Product Instance, but it is not implemented
by any other kind of feature.
- Parameters:
-
- ipObject
- The given Product.
It can be a Product Instance or a Product Reference.
- Returns:
- A logical value.
Legal values:
- TRUE
- this is an instance of ipObject.
- FALSE
- Either this is not an instance of ipObject or this is neither a Product Instance nor a Product Reference.
o IsReference
public virtual IsReference( | ) |
-
Checks whether the current object is a Reference object.
Role: This method checks if this is a Reference object.
- Returns:
- A logical value.
Legal values:
- TRUE
- The current object is a Reference object (can only be a VPMReference)
- FALSE
- The current object is not a Reference object.
o IsRoot
-
Checks whether the current object is a Root object.
Role: This method checks if this is a Root object.
On a Root object, GetFatherProduct does not return any father, and GetRootFather return this.
- Returns:
- A logical value.
Legal values:
- TRUE
- VPMReference, VPMRootOccurrence and multi-instantiable VPMRepReference are Root object
- FALSE
- VPMInstance, VPMPort, VPMRepInstance, VPMOccurrence, mono-instantiable VPMRepReference are NOT Root object.
This object is included in the file: CATIPrdObject.h
If needed, your Imakefile.mk should include the module: CATProductStructureInterfaces
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.