FeatureModelerExt CATFmContainerFacade

Usage: you must use this class as is. You should never derive it.


public class CATFmContainerFacade

Class representing a Feature Container.
Role: This class is a Facade object providing access to a Feature Container, according to the provided Accreditations.
It gathers in a single place all operations defined at the Feature Modeler level that can be performed on a Feature Container.

Lifecycle information.
The recommended usage is to create Facades as local variables in functions and methods bodies.
Facades expose methods such as and that can explicitly change the life cycle of objects they reference, but the mere existence of a Facade should not implicitely influence the life cycle (either logical or C++) of the object it is bound to. Consequently Facades use weak references to ensure secure operation: attempts to access deleted objects will safely fail. Facades are then not really intended to be used as global variables or class member data. The life cycle of Facades should not extend beyond the scope of the function in which they have been created, and cannot be used safely to store a reference to an object over an extended duration. Most notably, while the correct comparison (see ) of 2 AddRef'd pointers can descriminate between two pointers to the same Logically deleted object and two pointers to the distinct Logically deleted objects,the comparison of 2 Facades does not provide this ability.
Refer to the CAA Encyclopedia Feature Modeler pages to learn how to manage the Life Cycle of your objects.

Access Control information.
Interactions with Feature Modeler entities, either read-only or read+write, are subject to authorization.
On a Facade with no (or insufficient) Accreditations only the methods related to the Facade binding will succeed. Such a Facade can most notably be used as an output parameter for a method like to retrieve immediatly a pointer to the Feature Container through or . All other methods, i.e. those for wich E_ACCESSDENIED is a legal return value, will fail.
To be allowed to create Feature Containers, instantiate its own Features in a Feature Container and scan a Feature Container for its own Features, an application must be registered as being based on Feature Modeler.

See also:


Constructor and Destructor Index


o CATFmContainerFacade()
Constructs an empty Feature Container Facade.
o CATFmContainerFacade(CATFmCredentials&)
Constructs a Feature Container Facade.
o CATFmContainerFacade(CATFmContainerFacade&)
Copy constructor.
o CATFmContainerFacade(CATFmCredentials&,CATBaseUnknown*)
Constructs a Feature Container Facade.
o ~CATFmContainerFacade()
Destructor.

Method Index


o Clear()
Unbinds the Facade from its bound Feature Container.
o CompareContainerWith(CATFmContainerFacade&)
Compares the bound Feature Container(s) of two Facades.
o GetContainer()
Returns the bound Feature Container through a CATBaseUnknown smart pointer.
o IsValid()
Checks the Facade validity.
o QueryInterfaceOnContainer(IID&,void**)
Retrieves the bound Feature Container through a user specified interface pointer.
o ScanFeatures(CATFmFeatureIterator&)
Scans the bound Container for Features.
o ScanRootFeatures(CATFmFeatureIterator&)
Scans the bound Container for Root Features.
o operator!()
Logical-negation (or logical-NOT) operator.
o operator=(CATBaseUnknown*)
Binds the Facade to a Feature Container.
o operator=(CATFmContainerFacade&)
Assignment operator.

Constructor and Destructor


o CATFmContainerFacade
public CATFmContainerFacade()
Constructs an empty Feature Container Facade.
Role: This constructor creates a Facade with no Accreditation and not bound to any Feature Container.
Only the assignment operator can affect the Accreditations Set of a Facade after its construction.
o CATFmContainerFacade
public CATFmContainerFacade( const iAccreditations)
Constructs a Feature Container Facade.
Role: This constructor creates a Facade with the provided Accreditations Set and not bound to any Feature Container.
Parameters:
iAccreditations
[in] The Accreditations Set obtained by the application. Refer to the Access Control section of the
class documentation.
Only the assignment operator can affect the Accreditations Set of a Facade after its construction.
Lifecycle: A Facade keeps a copy of the Accreditations Set. Any change in iAccreditations (RegisterAsCatalogOwner ...) performed after the Facade creation will not affect the Facade.
o CATFmContainerFacade
public CATFmContainerFacade( const iContainerFacade)
Copy constructor.
Role: This method creates an exact copy of a Feature Container Facade.
Parameters:
iContainerFacade
[in] The Facade to copy.
o CATFmContainerFacade
public CATFmContainerFacade( const iAccreditations,
iContainer)
Constructs a Feature Container Facade.
Role: This constructor creates a Facade with the provided Accreditations Set and bound to a Feature Container.
Parameters:
iAccreditations
[in] The Accreditations Set obtained by the application. Refer to the Access Control section of the
class documentation.
Only the assignment operator can affect the Accreditations Set of a Facade after its construction.
Lifecycle: A Facade keeps a copy of the Accreditations Set. Any change in iAccreditations (RegisterAsCatalogOwner ...) performed after the Facade creation will not affect the Facade.
iContainer
[in] Any interface on the Container, as a CATBaseUnknown pointer.
Legal values:
  • NULL
  • Any interface pointer on a Feature Container.
Any other value, such as an interface on an object that is not a Feature Container, will be handled like a NULL pointer.
Lifecycle: Refer to the Lifecycle section of the
class documentation.
o ~CATFmContainerFacade
public ~CATFmContainerFacade()
Destructor.

Methods


o Clear
public Clear()
Unbinds the Facade from its bound Feature Container.
This method does not affect the Accreditations Set of the Facade.
Returns:
This Facade.
o CompareContainerWith
public CompareContainerWith( const iContainerFacade)
Compares the bound Feature Container(s) of two Facades.
Role: compares the bound Feature Container(s) of two Facades without taking the Accreditations into account.
An Feature Container is valid if and only has neither been Logically deleted nor unloaded.
Parameters:
iContainerFacade
[in] The Feature Container Facade to be compared to this.
Returns:
An integer value.
Legal values:
  • TRUE: if the Facades are either both invalid or both bound to the same valid Feature Container.
  • FALSE: in any other case.
o GetContainer
public GetContainer()
Returns the bound Feature Container through a CATBaseUnknown smart pointer.
Role: Use to retrieve an Applicative Modeler level interface on the bound Feature Container through smart pointers.
Returns:
A smart pointer to the Feature Container.
Warning: the exact type of the interface returned as a CATBaseUnknown pointer is not part of the specification and may vary. Do not make any assumption about it.
o IsValid
public IsValid()
Checks the Facade validity.
A Feature Container Facade is valid if and only if it is bound to a Feature Container that has neither been Logically deleted nor unloaded.
Returns:
An integer value.
Legal values:
  • TRUE: if the Facade is valid.
  • FALSE: if the Facade is invalid.
o QueryInterfaceOnContainer
public QueryInterfaceOnContainer( const iIID,
oPPV)
Retrieves the bound Feature Container through a user specified interface pointer.
Role: Use to query Applicative Modeler level interfaces on the bound Feature Container.
Parameters:
iIID
[in] The interface identifier for which a pointer is requested.
oPPV
[out, CATBaseUnknown#Release] The address where the returned pointer to the interface is located.
Returns:
An HRESULT value.
Legal values:
S_OK
The query succeeds.
E_NOINTERFACE
The interface does not exist.
E_FAIL
The object is not valid.
E_OUTOFMEMORY
A memory allocation failed.
E_UNEXPECTED
The query failed for any other reason.
See also:
o ScanFeatures
public ScanFeatures( oIterator)
Scans the bound Container for Features.
Role: This method fills an iterator with the Features found in a Container, either Root or not. "Root" Features are not-aggregated Features.
An application declared as being based on Feature Modeler will be able to find the Features defined in its registered catalogs (according to the provided Accreditations Set).
Parameters:
oIterator
[out] A (caller provided) Iterator that will be filled with the Features of this Container.
If the method fails oIterator is not modified, it is otherwise overwritten with the retrieved value.
Returns:
An HRESULT value.
Legal values:
S_OK
The Iterator has been successfuly populated.
E_ACCESSDENIED
Credentials do not grant access to this Feature Container.
E_INVALIDARG
Facade is not bound to a valid Container.
E_FMNOTLOADED
This Container is not loaded.
Other
Another failure has occured.
See also:
o ScanRootFeatures
public ScanRootFeatures( oIterator)
Scans the bound Container for Root Features.
Role: This method fills an iterator with the Root Features found in a Container. "Root" Features are not-aggregated Features.
An application declared as being based on Feature Modeler will be able to find the Features defined in its registered catalogs (according to the provided Accreditations Set).
Parameters:
oIterator
[out] A (caller provided) Iterator that will be filled with the Features of this Container.
If the method fails oIterator is not modified, it is otherwise overwritten with the retrieved value.
Returns:
An HRESULT value.
Legal values:
S_OK
The Iterator has been successfuly populated.
E_ACCESSDENIED
Credentials do not grant access to this Feature Container.
E_INVALIDARG
Facade is not bound to a valid Container.
E_FMNOTLOADED
This Container is not loaded.
Other
Another failure has occured.
See also:
o operator!
public operator!()
Logical-negation (or logical-NOT) operator.
Role: Checks if the Facade is invalid.
A Feature Container Facade is valid if and only if it is bound to a Feature Container that has neither been Logically deleted nor unloaded.
Returns:
An integer value.
Legal values:
  • 1: if the Facade is invalid.
  • 0: if the Facade is valid.
o operator=
public operator=( iContainer)
Binds the Facade to a Feature Container.
This method does not affect the Accreditations Set of the Facade.
Parameters:
iContainer
[in] Any interface pointer to the Container as a CATBaseUnknown pointer.
Legal values:
  • NULL
  • Any interface pointer on a Feature Container.
Any other value, such as an interface on an object that is not a Feature Container, will be handled like a NULL pointer.
Lifecycle: Refer to the Lifecycle section of the
class documentation.
Returns:
This Facade.
o operator=
public operator=( const iContainerFacade)
Assignment operator.
Role: This method transforms this Facade to an exact copy of another Feature Container Facade.
Both the Credentials and the bound Feature Container are copied.
Parameters:
iContainerFacade
[in] The Facade to copy.

This object is included in the file: CATFmContainerFacade.h
If needed, your Imakefile.mk should include the module: FeatureModelerExt

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.