/*
    <OUTPUTFILENAME>
    Created <DATE> from:
        Messages = <INPUTFILENAME>
        Template = <TEMPLATEFILENAME>
        Language = <LANGUAGEFILENAME>

                     AUTOGENERATED FILE, DO NOT EDIT

*/
var <MSGSHORTNAME> = function(buffer) {
    // have baseclass construct the buffer?
    //Message.call(this, MSG_SIZE);
        
    if (buffer==undefined)
    {
        buffer = new ArrayBuffer(<MSGSHORTNAME>.prototype.MSG_SIZE);
        this.m_data = new DataView(buffer);
        this.Init();
    }
    else
    {
        this.m_data = new DataView(buffer);
    }
};

// how to make constants?
<MSGSHORTNAME>.prototype.MSG_SIZE = <MSGSIZE>;
<MSGSHORTNAME>.prototype.MSG_NAME = "<MSGDESCRIPTOR>";

<MSGSHORTNAME>.prototype.Init = function(){
    <INIT_CODE>
};


// http://stackoverflow.com/a/130572
<ENUMERATIONS>
<ACCESSORS>
<MSGSHORTNAME>.prototype.SetMessageID = function(id){
    <SETMSGID>;
};
<MSGSHORTNAME>.prototype.GetMessageID = function(){
    return <GETMSGID>;
};

// Convert to a javascript object
<MSGSHORTNAME>.prototype.toObject = function(){
    ret = {};
    <STRUCTUNPACKING>
    return ret;
}

// Reflection information
<MSGSHORTNAME>.prototype.fields = [
    <REFLECTION>
]

// for react-native and node.js, we should set module.exports so our class can be accessed externally
if(typeof module != 'undefined' && typeof module.exports != 'undefined')
    module.exports.<MSGSHORTNAME> = <MSGSHORTNAME>;
