Class Ir

java.lang.Object
uk.co.real_logic.sbe.ir.Ir

public class Ir extends Object
Intermediate Representation (IR) of SBE messages to be used for the generation of encoders and decoders as stubs in various languages.
  • 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 headerStructure Tokens 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

      public HeaderStructure headerStructure()
      Return the HeaderStructure description for all messages.
      Returns:
      the HeaderStructure description for all messages.
    • addMessage

      public void addMessage(long messageId, List<Token> messageTokens)
      Add a List of Tokens for a given message id.
      Parameters:
      messageId - to identify the list of tokens for the message.
      messageTokens - the List of Tokens representing the message.
    • getMessage

      public List<Token> getMessage(long messageId)
      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

      public List<Token> getType(String name)
      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

      public Collection<List<Token>> types()
      Get the Collection of types in for this schema.
      Returns:
      the Collection of types in for this schema.
    • messages

      public Collection<List<Token>> messages()
      The Collection of messages in this schema.
      Returns:
      the Collection of messages in this schema.
    • packageName

      public String packageName()
      Get the package name to be used for generated code.
      Returns:
      the package name to be used for generated code.
    • namespaceName

      public String namespaceName()
      Get the namespaceName to be used for generated code.
      Returns:
      the namespaceName to be used for generated code.
    • namespaces

      public String[] 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

      public String description()
      Get the description for the schema.
      Returns:
      the description for the schema.
    • semanticVersion

      public String semanticVersion()
      Get the semantic version of the schema.
      Returns:
      the semantic version of the schema as applicable to the layer 7 application.
    • byteOrder

      public ByteOrder byteOrder()
      ByteOrder for all types in the schema.
      Returns:
      ByteOrder for all types in the schema.
    • applicableNamespace

      public String applicableNamespace()
      Get the namespaceName to be used for generated code.

      If namespaceName is null then packageName is used.

      Returns:
      the namespaceName to be used for generated code.
    • updateComponentTokenCounts

      public static void updateComponentTokenCounts(List<Token> tokens)
      Iterate over a list of Tokens and update their counts of how many tokens make up each component.
      Parameters:
      tokens - not be updated.