Sample Definition Queue Put(nameid, elName) {
int tmpH = ($<nameid>.tail+1) % DEFAULT_QUEUE_SIZE;
if(tmpH != $<nameid>.head){
$<nameid>.tail = tmpH;
$<nameid>.q[$<nameid>.tail] = $<elName>;
};
} Put <elName> at the end of queue <nameid>. The generated code for the operation put!() for elements of type Queue.Generated in the file <module>.c, or glob_func.c for user's functions. For Data-Item DI_Q of type Queue, and DI_IN to put into the queue:if(tmpH !=
DI_Q.head){
DI_Q.tail =
tmpH;
Queue Urgent Put(nameid, elName) {
int tmpH = ($<nameid>.head - 1 + DEFAULT_QUEUE_SIZE) % DEFAULT_QUEUE_SIZE;
if(tmpH != $<nameid>.tail){
$<nameid>.q[$<nameid>.head] = $<elName>;
$<nameid>.head = tmpH;
};
} Put <elName> at the beginning of queue <nameid>. The generated code for the operation uput!() for elements of type Queue.Generated in the file <module>.c, or glob_func.c for user's functions. For Data-Item DI_Q of type Queue, and DI_IN to put into the queue:if(tmpH !=
DI_Q.tail){
DI_Q.head =
tmpH;
Queue Get(nameid, elName, statElName) ?<begin> $<statElName> ?<==> ?<?>{if($<nameid>.tail != $<nameid>.head){$<nameid>.head = ($<nameid>.head + 1) % DEFAULT_QUEUE_SIZE;$<elName> = $<nameid>.q[$<nameid>.head];if($<nameid>.tail != $<nameid>.head){$<nameid>.head = ($<nameid>.head + 1) % DEFAULT_QUEUE_SIZE;$<elName> = $<nameid>.q[$<nameid>.head];else{ MAKE_FALSE($<statElName>); Remove value from front of queue <nameid>, return value in <elName>, and set <statElName> successful. The generated code for the operation get!() for elements of type Queue.Generated in the file <module>.c, or glob_func.c for user's functions. For Data-Item DI_Q of type Queue, and DI_OUT to set with the operation's value, and STAT as the status variable name:if(DI_Q.tail
!= DI_Q.head){
Queue Peek(nameid, elName, statElName) ?<begin> $<statElName> ?<==> ?<?>{if($<nameid>.tail != $<nameid>.head){$<elName> = $<nameid>.q[($<nameid>.head+1) % DEFAULT_QUEUE_SIZE];if($<nameid>.tail != $<nameid>.head){$<elName> = $<nameid>.q[($<nameid>.head+1) % DEFAULT_QUEUE_SIZE]; Copy value from front of queue <nameid>, return value in <elName>, and set <statElName> successful. The generated code for the operation peek!() for elements of type Queue.Generated in the file <module>.c, or glob_func.c for user's functions. For Data-Item DI_Q of type Queue, and DI_OUT to set with the operation's value, and STAT as the status variable name:if(DI_Q.tail
!= DI_Q.head){
Queue Flush(nameid) $<nameid>.head = 0;
$<nameid>.tail = 0; Remove all elements from queue <nameid> The generated code for the operation fl!() for elements of type Queue.Generated in the file <module>.c, or glob_func.c for user's functions. For Data-Item DI_Q of type Queue: Queue Length(nameid) ($<nameid>.head <= $<nameid>.tail ? $<nameid>.tail - $<nameid>.head : DEFAULT_QUEUE_SIZE - ($<nameid>.head - $<nameid>.tail)) Return length of Queue <nameid> The generated code for the operation q_length() for elements of type Queue.Generated in the file <module>.c, or glob_func.c for user's functions. For Data-Item DI_Q of type Queue: