设为首页 加入收藏

TOP

4.10.1 类摘要
2013-10-07 15:01:58 来源: 作者: 【 】 浏览:72
Tags:4.10.1 摘要

4.10.1  类摘要

uuid库使用类uuid来表示UUID,它的类摘要如下:

  1. class uuid {  
  2. public:  
  3.     static size_type static_size();  
  4.     size_type size() const;  
  5.     uint8_t data[static_size()];//内部实现  
  6.  
  7.     iterator begin();  
  8.     iterator end();  
  9.  
  10.     bool is_nil() const;  
  11.       
  12.     enum variant_type {  
  13.         variant_ncs,            //NCS backward compatibility  
  14.         variant_rfc_4122,       //defined in RFC 4122 document  
  15.         variant_microsoft,  //Microsoft Corporation backward compatibility  
  16.         variant_future      //future definition  
  17.     };  
  18.     variant_type variant() const;  
  19.  
  20.     enum version_type {  
  21.         version_unknown = -1,  
  22.         version_time_based = 1,  
  23.         version_dce_security = 2,  
  24.         version_name_based_md5 = 3,  
  25.         version_random_number_based = 4,  
  26.         version_name_based_sha1 = 5 
  27.     };  
  28.     version_type version() const;  
  29.  
  30.     void swap(uuid& rhs);  
  31. };  

在以上列出的成员函数之外,uuid还全面支持比较操作和流输入输出。两个uuid值的比较是基于字典序的,分别使用了标准算法std::equal()和std:: lexicographical_compare()。
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇4.11 config 下一篇4.10.2 用法

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: