00001 /* -*- Mode:c++ -*- */ 00002 00003 /* 00004 * Copyright (c) 2008 Regents of the SIGNET lab, University of Padova. 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 3. Neither the name of the University of Padova (SIGNET lab) nor the 00016 * names of its contributors may be used to endorse or promote products 00017 * derived from this software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00021 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00022 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00023 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00024 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00025 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00026 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00027 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00028 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00029 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 00032 #ifndef POSITION_CLMSG_H 00033 #define POSITION_CLMSG_H 00034 00035 #include <clmessage.h> 00036 00037 #define CLMSG_POSITION_VERBOSITY 2 // verbosity of this message 00038 00039 00040 extern ClMessage_t CLMSG_POSITION_GET_DIST; 00041 00042 00043 class ClMsgPositionGetDist : public ClMessage 00044 { 00045 public: 00046 ClMsgPositionGetDist(nsaddr_t i, nsaddr_t j); 00047 virtual ClMessage* copy(); // copy the message 00048 virtual void returnDist(double d); 00049 virtual double getDist() {return dist;} 00050 virtual nsaddr_t getId1() {return id1;} 00051 virtual nsaddr_t getId2() {return id2;} 00052 bool isValid() {return valid;} 00053 00054 protected: 00055 double dist; 00056 bool valid; 00057 nsaddr_t id1; 00058 nsaddr_t id2; 00059 }; 00060 00061 00062 00063 00064 00065 00066 #endif // POSITION_CLMSG_H