Blueprint Help Send comments on this topic.
Automatic Connections

Glossary Item Box

Overview

Automatic connections are not explicitly opened or closed but in order to extract the data or other information from their target objects, access functions are provided.  This section provides some examples of how to use these access functions to retrieve data from an automatic connection:

Examples

This example shows a connection between a consuming collector named 'A' and a providing 'N x M' dimensional transient store named 'B' which is connected for read access.  In this example the collector provides the trigger event for a scalar method which will therefore execute when all of the store elements have been written to. 

In this example, the collector provides the method's trigger and the trigger connection will have three categories of attributes as described above.  In this case, neither the providing collector, nor the consuming method have any specific attributes and so the connection will only have the three common attributes described above; Timeout, Signature and Name.

The automatic connection between the consuming collector and the providing store has a number of additional attributes.  The providing store has three specific attributes.  These are 'Access' (read or write), 'Key', and 'Rule'.  The rule is only required for the read access case, and the key is over-rideable in the 'write' access case (see Transient Store Connections).  The consuming collector has two specific attributes; 'Repeat Count' and 'connection label' (see Collector Connections).  The connection also has the three common attributes; Timeout, Signature and Name.

The translator will generate three access functions;

Trigger_AClx1Cxn()

Once the method has executed, this function will return a reference to the collector connection.  The connection can then be interrogated using its member functions (see Collector Connections).  In practice, collector connections are seldom interrogated.

Trigger_BTst1Cxn(
   Uns nm )

Once the method has executed, this function will return a reference to each store connection.  Note that this function takes a single argument that identifies each collected store event.

Trigger_BTst1Rec(
   Uns nm )

Once the method has executed, this function will return a reference to each store record.  Note that this function takes a single argument that identifies each collected store event.

The following code will call a user function to process each received store event.  Note that there is no explicit code required to open or close the method's providing objects because this is executed automatically by the scheduler.

for ( Uns n = 0; n < N; n++ )
{
   for ( Uns m = 0; m < M; m++ )
   {
      // Call user processing code with each store element's data
      Process( Trigger_BTst1Rec( n * M + m ) );
   }
}


This example shows a connection between a consuming multiplexer named 'A' and a providing 'N x M' dimensional transient store named 'B' which is connected for read access.  In this example the multiplexer provides the trigger event for a scalar method which will therefore execute if any of the store elements are written to. 

In this example, the multiplexer provides the method's trigger and the trigger connection will have three categories of attributes as described above.  In this case, neither the providing multiplexer, nor the consuming method have any specific attributes and so the connection will only have the three common attributes described above; Timeout, Signature and Name.

The automatic connection between the consuming multiplexer and the providing store has a number of additional attributes.  The providing store has three specific attributes.  These are 'Access' (read or write), 'Key', and 'Rule'.  The rule is only required for the read access case, and the key is over-rideable in the 'write' access case (see Transient Store Connections).  The consuming multiplexer has two specific attributes; 'Repeat Count' and 'Priority' (see Multiplexer Connections).  The connection also has the three common attributes; Timeout, Signature and Name.

The translator will generate two access functions;

Trigger_AMpx1Cxn()

Once the method has executed, this function will return a reference to the multiplexer connection.  The connection can then be interrogated using its member functions (see Multiplexer Connections).

Trigger_BTst1Cxn()

Once the method has executed, this function will return a reference to the store connection.  Note that this function does not take any arguments because the example multiplexer only has one (multidimensional) connection, and multiplexors can only return one event at a time.

The following code will call a user function to process the received store event.  It uses the multiplexer's element number to determine the providing store's 2-D coordinate.

Uns elemRow;  // Store element's 'row'
Uns elemCol;  // Store element's 'column'

elemRow = Trigger_AMpx1Cxn().ElemNum()/M;  // Calculate row
elemCol = Trigger_AMpx1Cxn().ElemNum()%M;  // Calculate column

// Call user processing code with store data and co-ordinates
Process( Trigger_BTst1Rec(), // Store's data record
         elemRow, 
         elemCol );