'''
Created on Nov 3, 2011
@version: 0.1
@author: Dilum Bandara
@email: dilumb@engr.colostate.edu
@copyright: Copyright(c) 2011, Dilum Bandara
@license: GPL
'''

class OverlayJoinRequestMsg(object):
    '''
    Overlay Join Message class
    '''

    def __init__(self, NID, loc, appType, addToOveraly):
        '''
        Constructor
        @param NID: Node ID of sender 
        @param loc: Location of node wishing to join
        @param appType: Application layer type
        @param addToOveraly: Add to overlay as a fully functional node 
        '''
        self.msgType = 'OvJoin'
        self.NID = NID
        self.loc = loc
        self.nodeType = appType
        self.inOveraly = addToOveraly
        # 20 * 8 - NID, locX, locY is 4-bytes, nodeType & addToOverlay 1 byte
        self.size = float((20 + len(appType)) * 8)
