Version: 10.16.0
Class

solace.SDTStreamContainer

Contents

class solace.SDTStreamContainer

Defines a Structured Data Type (SDT) stream container. A stream is an iterable collection of solace.SDTFields.

Constructor Top

  SDTStreamContainer ( )

Methods Top

void addField ( solace.SDTField | solace.SDTFieldType typeOrField, * value )
solace.SDTField getNext ( )
Boolean hasNext ( )
void rewind ( )

Constructor details Top

SDTStreamContainer ( )

Defines a Structured Data Type (SDT) stream container. A stream is an iterable collection of solace.SDTFields.

Methods Detail Top

public void addField ( solace.SDTField | solace.SDTFieldType typeOrField, * value )

Appends a field to this stream.

Deprecated: If typeOrField is a solace.SDTField instance, it is appended to the stream. The preferred usage is to pass a solace.SDTFieldType, then the API will create a SDTField of this type using value and append this new SDTField to the stream.

Parameters

solace.SDTField | solace.SDTFieldType typeOrField

A SDTField instance or SDTFieldType.

* value

The value to wrap as an SDTField.

(Optional)

Return Value

void

Throws

solace.OperationError if value does not match type

solace.SDTUnsupportedValueError if value is not in range supported by the platform/runtime

public solace.SDTField getNext ( )

Returns the next field in the stream and advances the read pointer. If the end of the stream is reached, it returns undefined.

Return Value

solace.SDTField

The next field in the stream.

public Boolean hasNext ( )

Returns true if the stream has at least one more solace.SDTField at the current position.

Return Value

Boolean

true, if there is an available field at the read pointer; false, otherwise.

public void rewind ( )

Rewinds the read pointer to the beginning of the stream. Normally when hasNext returns false, a client application must call rewind() to reiterate over the stream's fields.

Return Value

void

Throws

solace.OperationError if the stream cannot be rewound.