Class FMUBuilder


  • public class FMUBuilder
    extends java.lang.Object
    Build a FMU shared object.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$, $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.StringBuffer buffer
      The StringBuffer to which the output is appended.
    • Constructor Summary

      Constructors 
      Constructor Description
      FMUBuilder()
      Create a FMUBuilder.
      FMUBuilder​(boolean appendToStderrAndStdout)
      Create a FMUBuilder and optionally append to stderr and stdout as the commands are executed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean build​(java.io.File sharedLibraryFile)
      Build the specified shared library inside the FMU.
      void stderr​(java.lang.String text)
      Append the text message to the StringBuffer.
      void stdout​(java.lang.String text)
      Append the text message to the StringBuffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buffer

        public java.lang.StringBuffer buffer
        The StringBuffer to which the output is appended. This variable is public so that callers can clear the buffer as necessary.
    • Constructor Detail

      • FMUBuilder

        public FMUBuilder()
        Create a FMUBuilder. As the commands are executed, output is appended to the StringBuffer - no output will appear on stderr and stdout.
      • FMUBuilder

        public FMUBuilder​(boolean appendToStderrAndStdout)
        Create a FMUBuilder and optionally append to stderr and stdout as the commands are executed.
        Parameters:
        appendToStderrAndStdout - If true, then as the commands are executed, the output is append to stderr and stdout.
    • Method Detail

      • build

        public boolean build​(java.io.File sharedLibraryFile)
                      throws java.io.IOException
        Build the specified shared library inside the FMU.

        A typical value is /tmp/FMUFile12345/binaries/linux64/stepCounter.dylib.

        Typically the sharedLibrary is inside a temporary directory that was created when the fmu file was unzipped. The directory names the platform for which the binary is to be built. This directory resides inside a directory named binaries/. Adjacent to the binaries/ directory is the sources/ directory.

        Parameters:
        sharedLibraryFile - The shared library that should be built.
        Returns:
        true if the sharedLibraryFile was built.
        Throws:
        java.io.IOException - If the FMU contains a makefile but there was a problem building the shared library.
      • stderr

        public void stderr​(java.lang.String text)
        Append the text message to the StringBuffer. The output automatically gets a trailing end of line character(s) appended. Optionally, the text also appears on stderr
        Parameters:
        text - The text to append.
      • stdout

        public void stdout​(java.lang.String text)
        Append the text message to the StringBuffer. The output automatically gets end of line character(s) appended. Optionally, the text also appears on stdout.
        Parameters:
        text - The text to append.