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

📄 constants.cc,v

📁 这是P2P流媒体方案-NICE的实现源码
💻 CC,V
字号:
head	1.1;access;symbols;locks; strict;comment	@// @;1.1date	2002.07.02.19.28.53;	author rbraud;	state Exp;branches;next	;desc@@1.1log@Initial revision@text@/* * File: constants.cc * Author: Suman Banerjee <suman@@cs.umd.edu> * Date: 15th February, 2002 * Terms: GPL * * NICE Application Layer Multicast *//*#include <string.h>#include <assert.h>*/#include "constants.h"int NamedConstant::const_id_gen = 0;LinkedList<NamedConstant*,int> NamedConstant::constant_list;/*LinkedList<void *, int> constant_list;int get_next_constant_id (void) {  int ret_val = const_id_gen++;  return ret_val;}void add_to_constant_list (void * const_ptr, int id) {  constant_list.Add(const_ptr,id);  return;}void delete_from_constant_list (int id) {  void * pos = constant_list.Locate(id);  assert (pos != NULL);  constant_list.RemoveAt(pos);}template<class ConstType>void Constant<ConstType>::setval(char * Cname, ConstType val) {  bool found = false;  for (void * pos = constant_list.GetHeadPosition();       pos != NULL;       constant_list.GetNext(pos) ) {    Constant<ConstType> * this_const = constant_list.GetAt(pos);    assert (this_const != NULL);    if (strcmp(this_const->cname,Cname) == 0) {      this_const->val = Val;      found = true;      break;    }  }  assert (found == true);  return;}void constant_setval(char * Cname, int ival, double dval, bool is_int) {  bool found = false;  for (void * pos = constant_list.GetHeadPosition();       pos != NULL;       constant_list.GetNext(pos) ) {    void* this_const = (void*)(constant_list.GetAt(pos));    assert (this_const != NULL);    if (strcmp(((Constant<int>*)this_const)->cname,Cname) == 0) {      if (is_int == true)        ((Constant<int>*)this_const)->val = ival;      else        ((Constant<double>*)this_const)->val = dval;      found = true;      break;    }  }  assert (found == true);  return;}*/@

⌨️ 快捷键说明

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