import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
/**
- * <b><u>SequenceDeclaration</u></b>
+ * A CTF sequence declaration.
+ *
+ * An array where the size is fixed but declared in the trace, unlike array
+ * where it is declared with a literal
+ *
+ * @version 1.0
+ * @author Matthew Khouzam
+ * @author Simon Marchi
*/
public class SequenceDeclaration implements IDeclaration {
// Constructors
// ------------------------------------------------------------------------
+ /**
+ * Constructor
+ *
+ * @param lengthName
+ * the name of the field describing the length
+ * @param elemType
+ * The element type
+ */
public SequenceDeclaration(String lengthName, IDeclaration elemType) {
this.elemType = elemType;
this.lengthName = lengthName;
}
// ------------------------------------------------------------------------
- // Gettters/Setters/Predicates
+ // Getters/Setters/Predicates
// ------------------------------------------------------------------------
+ /**
+ * Gets the element type
+ * @return the element type
+ */
public IDeclaration getElementType() {
return elemType;
}
+ /**
+ * Gets the name of the length field
+ * @return the name of the length field
+ */
public String getLengthName() {
return lengthName;
}
+ @Override
+ public long getAlignment() {
+ return getElementType().getAlignment();
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------