AfrFoundation CATAfrCommandSequence

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


public class CATAfrCommandSequence

Class representing a command sequence.

Role: A sequence is a list of couples {command header identifier, argument list}. The sequence execution begins with the execution of the command pointed by the first command header and it ends with the execution of the command pointed by the last command header.

Kinds of Sequences.


Constructor and Destructor Index


o ~CATAfrCommandSequence()

Method Index


o Append(CATAfrCommandHeaderStartInfo&)
Add a command information to the list.
o CATDeclareCBEvent(SEQUENCE_ENDED)
Event sent when the sequence ends.
o Continue()
Continue the command sequence.
o Create()
Create a command sequence.
o GetCommandHeaderStartInfo(int,CATAfrCommandHeaderStartInfo&)
Access to a command information.
o GetSequence(CATAfrCommandSequence*&)
Access to the command sequence.
o GetSize(int&)
Give the size of the list.
o RemovePosition(int)
Remove a command information.
o Start()
Start the command sequence.

Constructor and Destructor


o ~CATAfrCommandSequence
public virtual ~CATAfrCommandSequence()

Methods


o Append
public Append( const iStartInfo)
Add a command information to the list. Role:Adds a command information object at the end of the list.
There is no way to add in the middle of the list.
Returns:
always S_OK.
o CATDeclareCBEvent
public CATDeclareCBEvent( )
Event sent when the sequence ends.
Role:
this event is sent by the sequence when it ends, normally or not. It may be useful to end the object that started the sequence.
Sample of use:
 ::AddCallback(this,
               pSequence,
	             CATAfrCommandSequence::SEQUENCE_ENDED(),
	             (CATSubscriberMethod)&MyClass::MyCBMethod,
	             NULL);
 
o Continue
public static Continue()
Continue the command sequence. Role:Continue the current sequence by starting the next command in the sequence.
The preceding command is removed from the sequence AND RequestDelayedDestruction is called on it to stop it.
Each command in the sequence must call Continue, even the last one, else the sequence will never step to the next command of the sequence. If this service fails (see causes below) the sequence is deleted.
The output and input-output parameters of the preceding command are matched with the input and input-output parameters of the next command: if identifiers are equal and value types are the same, the value of the output is copied to the input, even if the input already has a value.
Returns:
S_OK if continuation succeeds, E_FAIL if no sequence was found or the command header was not found or the command header did not start any command.
o Create
public static Create()
Create a command sequence. Role:Calls the constructor to create the current sequence.
Do not directly call the constructor, the sequence would be unusable.
Only one sequence may be running. Calling this method a second time before the first sequence ends will not create a sequence and will return an error code.
Returns:
S_OK if creation succeeds, E_FAIL if no sequence could be created.
o GetCommandHeaderStartInfo
public GetCommandHeaderStartInfo( const iIndex,
oStartInfo)
Access to a command information. Role:Returns the information about a command of the sequence.
Parameters:
iIndex
The number of the object to get in the list.
oStartInfo
The command information object.
Returns:
S_OK if info was found, E_INVALIDARG if index is out of bounds.
o GetSequence
public static GetSequence( oCurrentSequence)
Access to the command sequence. Role:Returns the running sequence.
The running sequence may be queried from anywhere while it is running.
The returned sequence is modifyable by using other methods of this class.
Parameters:
oCurrentSequence
The sequence.
Returns:
S_OK if continuation succeeds, E_FAIL if no sequence was found.
o GetSize
public GetSize( oSize)
Give the size of the list. Role:Returns the number of objects in the list.
Parameters:
oSize
The size.
Returns:
always S_OK.
o RemovePosition
public RemovePosition( const iIndex)
Remove a command information. Role:Deletes the information about a command of the sequence.
Parameters:
iIndex
The number of the object to remove from the list.
Returns:
S_OK if remove was done, E_INVALIDARG if index is out of bounds.
o Start
public static Start()
Start the command sequence. Role:Starts the current sequence by starting the first command in the sequence. If this service fails (see causes below) the sequence is deleted.
Returns:
S_OK if start succeeds, E_FAIL if no sequence was found or the command header was not found or the command header did not start any command.

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

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