-\verbatim
-module SALOMEDS{
- interface StudyBuilder{
- boolean FindAttribute ( in SObject anObject,
- out GenericAttribute anAttribute,
- in string aTypeOfAttribute );
- };
-};
-\endverbatim
-
-a client could write
-
-\verbatim
-from SALOMEDS import StudyBuilder;
-my_StudyBuilder=...
-
- res,A=my_StudyBuilder.FindAttribute(Sobj, "AttributeSequenceOfReal")
-\endverbatim
-
-In this example <STRONG>A</STRONG> corresponds to the return value <STRONG>anAttribute</STRONG> and
-<STRONG>res</STRONG> to the <STRONG>boolean</STRONG> return value.
-
-If an interface defines an <STRONG>attribute name</STRONG>, for example, the attribute is mapped into an
-operation <STRONG>_get_name</STRONG>. If the attribute is not <STRONG>readonly</STRONG>, there is an
-additional operation <STRONG>_set_name</STRONG>.
-
-The IDL definition
-
-\verbatim
-module SALOMEDS{
- interface Study{
- attribute string Name;
- };
-};
-\endverbatim
-
-is equal to the following
-
-\verbatim
-from SALOMEDS import Study
-My_Study=...
- Name=My_Study._get_name();
- Name=My_Study._set_name();
-\endverbatim
-
-\subsection subsection4 Narrowing Object References
-
-Python objects returned from CORBA operations or pseudo-operations (such as
-string_to_object) might have a dynamic type, which is more specific than the
-static type as defined in the operation signature.
-
-Since there is no efficient and reliable way of automatically creating the most specific
-type, explicit narrowing is necessary. To narrow an object reference <STRONG>A</STRONG> to an interface
-class <STRONG>AttributeSequenceOfReal</STRONG>, the client can use the following operation
-
-\verbatim
-A = A._narrow(SALOMEDS.AttributeSequenceOfReal)
-\endverbatim
-
-\subsection subsection5 Mapping for Exceptions
-
-An IDL exception is translated into a Python class derived from
-CORBA.UserException. System exceptions are derived from CORBA.SystemException.
-Both base classes are derived from CORBA.Exception. The parameters of the
-exception are mapped in the same way as the fields of a struct definition. When
-raising an exception, a new instance of the class is created; the constructor
-expects the exception parameters. For example, the definition
-
-\verbatim
-module SALOMEDS{
- interface StudyBuilder{
- exception LockProtection {};
- void CommitCommand() raises(LockProtection);
- };
-};
-\endverbatim
-
-could be used caught as
-
-\verbatim
-from SALOMEDS import StudyBuilder;
-my_StudyBuilder=...
-try:
- my_StudyBuilder.CommitCommand();
-except StudyBuilder.LockProtection,value:
- print "Error! Study is locked for modifications"
-\endverbatim
-
-
-\subsection subsection6 Mapping for Enumeration Types
-
-An enumeration is mapped into a number of constant objects in the name space where
-the enumeration is defined. An application may only test for equivalence of two
-enumeration values, and not assume that they behave like numbers.
-For example, the definition
-
-\verbatim
-module VISU {
- interface PrsObject{
-
- enum PrsObjType{ TCURVE, TTABLE, TMESH, TCONTAINER,
- TSCALARMAP, TISOSURFACE, TDEFORMEDSHAPE,
- TCUTPLANES, TVECTORS };
- };
-};
-\endverbatim