/* LCM type definition class file
 * This file was automatically generated by lcm-gen
 * DO NOT MODIFY BY HAND!!!!
 */

using System;
using System.Collections.Generic;
using System.IO;
using LCM.LCM;
 
namespace LCMTypes
{
    public sealed class temperature_t : LCM.LCM.LCMEncodable
    {
        public long utime;
        public double deg_celsius;
 
        public temperature_t()
        {
        }
 
        public static readonly ulong LCM_FINGERPRINT;
        public static readonly ulong LCM_FINGERPRINT_BASE = 0x2a1f28faae9b227bL;
 
        static temperature_t()
        {
            LCM_FINGERPRINT = _hashRecursive(new List<String>());
        }
 
        public static ulong _hashRecursive(List<String> classes)
        {
            if (classes.Contains("LCMTypes.temperature_t"))
                return 0L;
 
            classes.Add("LCMTypes.temperature_t");
            ulong hash = LCM_FINGERPRINT_BASE
                ;
            classes.RemoveAt(classes.Count - 1);
            return (hash<<1) + ((hash>>63)&1);
        }

        public void Encode(LCMDataOutputStream outs)
        {
            outs.Write((long) LCM_FINGERPRINT);
            _encodeRecursive(outs);
        }

        public void _encodeRecursive(LCMDataOutputStream outs)
        {
            byte[] __strbuf = null;
            outs.Write(this.utime); 
            outs.Write(this.deg_celsius); 
        }
 
        public temperature_t(byte[] data) : this(new LCMDataInputStream(data))
        {
        }

        public temperature_t(LCMDataInputStream ins)
        {
            if ((ulong) ins.ReadInt64() != LCM_FINGERPRINT)
                throw new System.IO.IOException("LCM Decode error: bad fingerprint");
 
            _decodeRecursive(ins);
        }

        public static LCMTypes.temperature_t _decodeRecursiveFactory(LCMDataInputStream ins)
        {
            LCMTypes.temperature_t o = new LCMTypes.temperature_t();
            o._decodeRecursive(ins);
            return o;
        }

        public void _decodeRecursive(LCMDataInputStream ins)
        {
            byte[] __strbuf = null;
            this.utime = ins.ReadInt64();
            this.deg_celsius = ins.ReadDouble();
        }
 
        public LCMTypes.temperature_t Copy()
        {
            LCMTypes.temperature_t outobj = new LCMTypes.temperature_t();
            outobj.utime = this.utime;
 
            outobj.deg_celsius = this.deg_celsius;
 
            return outobj;
        }
    }
}

