Loading...
 

SetPattern

SetPattern

SetPattern(CX_xxxxx, bitPattern)

parameters: Identifier of a class, bit pattern

Stack
Stack Description
Stack(In) -
Stack(Out) -

Often - following the idea of polymorphism - an object created with CreatePersObject should not only or not at all be inserted into the RootEP-Collection of its class, but together with instances of other derived classes into the collection of a base class. This behaviour is defined for the class specified in the first parameter. The bits of the second parameter stand for the classes of the inheritance path, starting from the right:

     Classes: .  .  .  C3 - C2 - C1 - C 
bitPattern . . . b3 b2 b1 b0

where C is derived from C1, C1 from C2, C2 from C3 etc. The default value can be set in the initialisation file CLASSIX.INI. If there is no specification there, 1 applies, i.e. the object becomes an element of the RootEP-Collection of its class. Value zero means: The object is not placed in a RootEP-Collection , i.e. it can only be reached via relations originating from another object.
The following example shows the connection between layer, domain and bitpattern for Inheritance.

Example

// All CX_TXN_NOTE objects will now be registered in its own collection

// and in the CX_TRANSACTION collection (one level above) also:
SetPattern
(CX_TXN_NOTE, 3)
CreatePersObject(CX_TXN_NOTE) -> txnNote // Is now registered in the two collections!

 

See also