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

📄 graphable_element.h

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 H
字号:
/* -*- C++ -*- */
// Graphable_Element.h,v 1.3 2004/01/08 16:33:45 shuston Exp

#ifndef GRAPHABLE_ELEMENT_H
#define GRAPHABLE_ELEMENT_H

#include "Name_Binding.h"
#include <list>

// A helper class that knows how to sort two ACE_Name_Binding objects
// which contain temperature metrics. The value stored in the binding
// is expected to be of the format "time|temp".
//
// Listing 1 code/ch21
class Graphable_Element : public Name_Binding
{
public:
  Graphable_Element (ACE_Name_Binding *entry)
    : Name_Binding(entry)
  {
    sscanf (this->value (), "%d|%f", &this->when_, &this->temp_);
  }
  // Listing 1

  // Listing 2 code/ch21
  inline int when (void) const
  {
    return this->when_;
  }

  inline float temp (void)
  {
    return this->temp_;
  }
  // Listing 2

  // Listing 3 code/ch21
  inline bool operator< (const Graphable_Element &other) const
  {
    return this->when () < other.when ();
  }
  // Listing 3

  // Listing 4 code/ch21
private:
  int when_;
  float temp_;
};

typedef std::list<Graphable_Element> Graphable_Element_List;
// Listing 4

#endif /* GRAPHABLE_ELEMENT_H */

⌨️ 快捷键说明

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