Package uk.co.real_logic.sbe.ir
Class Ir
java.lang.Object
uk.co.real_logic.sbe.ir.Ir
Intermediate Representation (IR) of SBE messages to be used for the generation of encoders and decoders
as stubs in various languages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(long messageId, List<Token> messageTokens) Add a List ofTokens for a given message id.Get the namespaceName to be used for generated code.ByteOrderfor all types in the schema.Get the description for the schema.getMessage(long messageId) Get the getMessage for a given identifier.Get the type representation for a given type name.Return theHeaderStructuredescription for all messages.intid()Get the id number of the schema.messages()TheCollectionof messages in this schema.Get the namespaceName to be used for generated code.String[]Get the namespaces array to be used for generated code.Get the package name to be used for generated code.Get the semantic version of the schema.types()Get theCollectionof types in for this schema.static voidupdateComponentTokenCounts(List<Token> tokens) Iterate over a list ofTokens and update their counts of how many tokens make up each component.intversion()Get the version of the schema.
-
Constructor Details
-
Ir
public Ir(String packageName, String namespaceName, int id, int version, String description, String semanticVersion, ByteOrder byteOrder, List<Token> headerTokens) Create a new IR container taking a defensive copy of the headerStructureTokens passed.- Parameters:
packageName- that should be applied to generated code.namespaceName- that should be applied to generated code.id- identifier for the schema.version- of the schema.description- of the schema.semanticVersion- semantic version for mapping to the application domain.byteOrder- byte order for all types in the schema.headerTokens- representing the message headerStructure.
-
-
Method Details
-
headerStructure
Return theHeaderStructuredescription for all messages.- Returns:
- the
HeaderStructuredescription for all messages.
-
addMessage
Add a List ofTokens for a given message id.- Parameters:
messageId- to identify the list of tokens for the message.messageTokens- the List ofTokens representing the message.
-
getMessage
Get the getMessage for a given identifier.- Parameters:
messageId- to get.- Returns:
- the List of
Tokens representing the message or null if the id is not found.
-
getType
Get the type representation for a given type name.- Parameters:
name- of type to get.- Returns:
- the List of
Tokens representing the type or null if the name is not found.
-
types
Get theCollectionof types in for this schema.- Returns:
- the
Collectionof types in for this schema.
-
messages
TheCollectionof messages in this schema.- Returns:
- the
Collectionof messages in this schema.
-
packageName
Get the package name to be used for generated code.- Returns:
- the package name to be used for generated code.
-
namespaceName
Get the namespaceName to be used for generated code.- Returns:
- the namespaceName to be used for generated code.
-
namespaces
Get the namespaces array to be used for generated code.- Returns:
- the namespaces array to be used for generated code.
-
id
public int id()Get the id number of the schema.- Returns:
- id number of the schema.
-
version
public int version()Get the version of the schema.- Returns:
- version number.
-
description
Get the description for the schema.- Returns:
- the description for the schema.
-
semanticVersion
Get the semantic version of the schema.- Returns:
- the semantic version of the schema as applicable to the layer 7 application.
-
byteOrder
ByteOrderfor all types in the schema.- Returns:
ByteOrderfor all types in the schema.
-
applicableNamespace
Get the namespaceName to be used for generated code.If
namespaceNameis null thenpackageNameis used.- Returns:
- the namespaceName to be used for generated code.
-
updateComponentTokenCounts
Iterate over a list ofTokens and update their counts of how many tokens make up each component.- Parameters:
tokens- not be updated.
-