diagapplet.CodeGen
Class DiagNMLMsgDict

java.lang.Object
  extended by diagapplet.CodeGen.DiagNMLMsgDict
All Implemented Interfaces:
DiagNMLMsgDictInterface, NMLMessageDictionary

public class DiagNMLMsgDict
extends java.lang.Object
implements NMLMessageDictionary, DiagNMLMsgDictInterface

* NMLMessageDictionaries allow the marshalling and unmarshalling of NML messages. They are generally created using the CodeGenerator and therefore have type information built in at compile-time. The Diag version must discover the type information at runtime.


Field Summary
static boolean debug_on
          When set to true debug_on enables extra calls to System.out for debugging.
 
Constructor Summary
DiagNMLMsgDict()
           
 
Method Summary
 void bytesNotUsed(int bytes_in_input_stream, java.lang.String bufName, boolean warn_given)
          Used to log a warning message if the dictionary results do not match the expected input.
static void ErrorPrint(java.lang.String s)
           
 int formatMsg(NMLFormatConverter NMLfc)
          This function should use NMLfc.type to select an object of the appropriate class, set NMLfc.msg_to_update to it, and call the objects update(NMLFormatConverter) function.
 int get_failed_count()
          Returns the number of errors that have occured related to this dictionary.
 long getEstimatedSize(int _type)
           
 long getMaxEstimatedSize()
           
 void miscError()
          Log Information about this dictionary when generic NML error occurs.
 void miscError(java.lang.Exception e)
          Log Information about this dictionary when NML error occurs with a related Exception called by NMLFormatConvertErrCallbackInterface
 void SetModuleInfoObject(ModuleInfoInterface o)
          Used to set a ModuleInfo object, needed for this to function.
 void tokensNotUsed(int num_tokens, java.lang.String input_string, boolean warn_given)
          Used to log a warning message if the dictionary results do not match the expected input.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug_on

public static volatile boolean debug_on
When set to true debug_on enables extra calls to System.out for debugging.

Constructor Detail

DiagNMLMsgDict

public DiagNMLMsgDict()
Method Detail

getEstimatedSize

public long getEstimatedSize(int _type)
Specified by:
getEstimatedSize in interface NMLMessageDictionary

getMaxEstimatedSize

public long getMaxEstimatedSize()
Specified by:
getMaxEstimatedSize in interface NMLMessageDictionary

tokensNotUsed

public void tokensNotUsed(int num_tokens,
                          java.lang.String input_string,
                          boolean warn_given)
Description copied from interface: DiagNMLMsgDictInterface
Used to log a warning message if the dictionary results do not match the expected input.

Specified by:
tokensNotUsed in interface DiagNMLMsgDictInterface
Parameters:
num_tokens - -- number tokens in input_string
input_string - -- comma delimited string to be parsed
warn_given - -- if already warned do not warn again.

bytesNotUsed

public void bytesNotUsed(int bytes_in_input_stream,
                         java.lang.String bufName,
                         boolean warn_given)
Description copied from interface: DiagNMLMsgDictInterface
Used to log a warning message if the dictionary results do not match the expected input.

Specified by:
bytesNotUsed in interface DiagNMLMsgDictInterface
Parameters:
bytes_in_input_stream - -- number of bytes read
bufName - -- NML buffer name
warn_given - -- if already warned do not warn again.

ErrorPrint

public static void ErrorPrint(java.lang.String s)

miscError

public void miscError()
Description copied from interface: DiagNMLMsgDictInterface
Log Information about this dictionary when generic NML error occurs. called by NMLFormatConvertErrCallbackInterface

Specified by:
miscError in interface DiagNMLMsgDictInterface

miscError

public void miscError(java.lang.Exception e)
Description copied from interface: DiagNMLMsgDictInterface
Log Information about this dictionary when NML error occurs with a related Exception called by NMLFormatConvertErrCallbackInterface

Specified by:
miscError in interface DiagNMLMsgDictInterface

SetModuleInfoObject

public void SetModuleInfoObject(ModuleInfoInterface o)
Description copied from interface: DiagNMLMsgDictInterface
Used to set a ModuleInfo object, needed for this to function. The non type safe use of an object parameter

Specified by:
SetModuleInfoObject in interface DiagNMLMsgDictInterface

get_failed_count

public int get_failed_count()
Description copied from interface: DiagNMLMsgDictInterface
Returns the number of errors that have occured related to this dictionary. incremented automatically.

Specified by:
get_failed_count in interface DiagNMLMsgDictInterface
Returns:
failed_count.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

formatMsg

public int formatMsg(NMLFormatConverter NMLfc)
Description copied from interface: NMLMessageDictionary
This function should use NMLfc.type to select an object of the appropriate class, set NMLfc.msg_to_update to it, and call the objects update(NMLFormatConverter) function.

Specified by:
formatMsg in interface NMLMessageDictionary
Parameters:
NMLfc - a format converter object which provides methods for updating all the basic types and is used to update the message, member-by-member.
Returns:
The function should return 0 if it is successful, -1 otherwise.