'''
Created on Apr 09, 2011
Modified on Apr 26, 2011
@author: Dilum Bandara
@version: 0.11
@copyright: Copyright(c) 2011, Dilum Bandara
@contact: dilumb@engr.colostate.edu
@license: GPL
'''

class BaseQueryMessage:
    '''
    Query message class. 
    '''
    def __init__(self, source, n, query):        
        '''        
        @param source: Source address
        @param n: Number of resources to query for
        @param query: List of attribute ranges ['att', min, max]
        '''
        self.source = source
        self.n = n
        self.query = query
        self.hops = 0 #Number of hops
        self.results = [] #List of nodes IDs satisfying query
        self.num_res_found = 0 #Number of resources found so far
        self.visited_peers = [] #List of nodes already visited
        self.success = False #Was query success