⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attribute.h

📁 基于Oment++的无线传感器网络仿真
💻 H
字号:
#ifndef _NR_HH_#define _NR_HH_#include <stdio.h>#include <stdlib.h>#include <vector>// #include "CommonIncludes.h"class Attribute;typedef std::vector<Attribute> AttrVec;class Attribute{public:  enum keys {    // reserved constant values used for key    // range 1000-1499 is diffusion-specific    LONGITUDE_L = 1001,    LATITUDE_L = 1002,    LONGITUDE_R = 1003,    LATITUDE_R = 1004,	LONGITUDE = 1005,	LATITUDE = 1006,	RADIUS = 1007  };  // Match Operator values  enum operators { IS, LE, GE, LT, GT, EQ, NE, EQ_ANY };  // with EQ_ANY, the val is ignored  Attribute();  Attribute(int key, int op, float val = 0.0);  virtual ~Attribute();  bool compareAttribute(float value);  static Attribute find_key_from(int key, AttrVec *attrs);  int32_t getKey() { return key_; };  int8_t getOp() { return op_; };  float getVal() { return val_; };  /*bool isSameKey(NRAttribute *attr) {    return ((type_ == attr->getType()) && (key_ == attr->getKey()));  };*/  bool isEQ(float value);  bool isGT(float value);  bool isGE(float value);  bool isNE(float value) {    return (!isEQ(value));  };  bool isLE(float value) {  	//printf( " IN LE \n");    return (!isGT(value));  };  bool isLT(float value) {    return (!isGE(value));  };  protected:  int32_t key_;  int8_t  op_;  float val_;};#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -