当前位置: 首页>>代码示例>>C++>>正文


C++ read_id函数代码示例

本文整理汇总了C++中read_id函数的典型用法代码示例。如果您正苦于以下问题:C++ read_id函数的具体用法?C++ read_id怎么用?C++ read_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了read_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: return

PackageCanvas * PackageCanvas::read(char * & st, UmlCanvas * canvas, char * k) {
  if (!strcmp(k, "packagecanvas_ref"))
    return ((PackageCanvas *) dict_get(read_id(st), "packagecanvas", canvas));
  else if (!strcmp(k, "packagecanvas")) {
    int id = read_id(st);
    BrowserNode * br = BrowserPackage::read_ref(st);
    UmlColor color = UmlDefaultColor;
    Uml3States in_tab = UmlDefaultState;
    ShowContextMode context = DefaultShowContextMode;
    Uml3States show_stereotype_properties = UmlDefaultState;;
    
    k = read_keyword(st);
    
    if (!strcmp(k, "name_in_tab")) {
      in_tab = state(read_keyword(st));
      k = read_keyword(st);
    }
    
    if (!strcmp(k, "show_context_mode")) {
      context = context_mode(read_keyword(st));
      k = read_keyword(st);
    }

    if (!strcmp(k, "show_stereotype_properties")) {
      show_stereotype_properties = state(read_keyword(st));
      k = read_keyword(st);
    }

    read_color(st, "color", color, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    int x = (int) read_double(st);
    PackageCanvas * result =
      new PackageCanvas(br, canvas, x, (int) read_double(st), id);
    
    read_zwh(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->name_in_tab = in_tab;
    result->show_context_mode = context;
    result->show_stereotype_properties = show_stereotype_properties;
    result->itscolor = color;
    result->check_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    
    return result;
  }
  else
    return 0;
}
开发者ID:kralf,项目名称:bouml,代码行数:60,代码来源:PackageCanvas.cpp

示例2: return

AssocContainCanvas * AssocContainCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "containcanvas_ref"))
    return ((AssocContainCanvas *) dict_get(read_id(st), "contain canvas", canvas));
  else if (!strcmp(k, "containcanvas")) {
    int id = read_id(st);    
    LineGeometry geo;
    bool fixed;
    
    k = read_keyword(st);	// may read id
    if (!strcmp(k, "geometry")) {
      geo = line_geometry(read_keyword(st));
      k = read_keyword(st);
      if (! strcmp(k, "unfixed")) {
	k = read_keyword(st);
	fixed = FALSE;
      }
      else
	fixed = TRUE;
    }
    else {
      geo = NoGeometry;
      fixed = FALSE;
    }
    
    float dbegin;
    float dend;

    if (! strcmp(k, "decenter_begin")) {
      dbegin = read_double(st) / 1000;
      k = read_keyword(st);
    }
    else
      dbegin = -1;

    if (! strcmp(k, "decenter_end")) {
      dend = read_double(st) / 1000;
      k = read_keyword(st);
    }
    else
      dend = -1;
    
    unread_keyword(k, st);
    
    AssocContainCanvas * r = (AssocContainCanvas *)
      read_list(st, canvas, UmlContain, geo, fixed, dbegin, dend, id, &make);
    
    // remove association between components available in the
    // 2.0 deployment diagrams
    if (r->begin->type() == UmlComponent)
      Undefined.append(r);
    else if (read_file_format() == 30)
      // to remove redondant transitions made by release 2.22
      RelsToCheck.append(r);
    
    return r;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:60,代码来源:AssocContainCanvas.cpp

示例3: read_id

void BrowserNode::read(char * & st, char * & k, int id) {
  if (in_lib_import()) {
    original_id = id;
    is_read_only = TRUE;
    
    if (! strcmp(k, "oid")) {
      // a sub lib is imported as a part of the imported lib
      (void) read_id(st);
      k = read_keyword(st);
    }
  }
  else if (! strcmp(k, "oid")) {
    original_id = read_id(st);
    is_read_only = TRUE;
    k = read_keyword(st);
  }
  
  HaveKeyValueData::read(st, k);
  
  if (!strcmp(k, "comment")) {
    comment = read_string(st);
    k = read_keyword(st);
  }
  
  is_new = FALSE;
}
开发者ID:SciBoy,项目名称:douml,代码行数:26,代码来源:BrowserNode.cpp

示例4: return

DeploymentNodeCanvas * DeploymentNodeCanvas::read(char * & st, UmlCanvas * canvas, char * k) {
  if (!strcmp(k, "deploymentnodecanvas_ref"))
    return ((DeploymentNodeCanvas *) dict_get(read_id(st), "deploymentnodecanvas", canvas));
  else if (!strcmp(k, "deploymentnodecanvas")) {
    int id = read_id(st);
    BrowserNode * br = BrowserDeploymentNode::read_ref(st);
    QString iname;
    Uml3States write_horizontally = UmlDefaultState;
    Uml3States show_stereotype_properties = UmlDefaultState;
    
    k = read_keyword(st);
    
    if (!strcmp(k, "name")) {
      iname = read_string(st);
      k = read_keyword(st);
    }
    if (!strcmp(k, "write_horizontally") ||
	!strcmp(k, "write_horizontaly")) {
      write_horizontally = state(read_keyword(st));
      k = read_keyword(st);
    }
    if (!strcmp(k, "show_stereotype_properties")) {
      show_stereotype_properties = state(read_keyword(st));
      k = read_keyword(st);
    }
    
    UmlColor color = UmlDefaultColor;
    
    read_color(st, "color", color, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    int x = (int) read_double(st);
    DeploymentNodeCanvas * result =
      new DeploymentNodeCanvas(br, canvas, x, (int) read_double(st), id);
    
    read_zwh(st, result);
    
    if (read_file_format() >= 58) {
      k = read_keyword(st);
      result->read_stereotype_property(st, k);	// updates k
      if (strcmp(k, "end"))
	wrong_keyword(k, "end");
    }
    
    result->iname = iname;
    result->write_horizontally = write_horizontally;
    result->show_stereotype_properties = show_stereotype_properties;
    result->itscolor = color;
    result->check_size();
    result->set_center100();
    result->show();
    result->check_stereotypeproperties();
    
    return result;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:60,代码来源:DeploymentNodeCanvas.cpp

示例5: return

SubjectCanvas * SubjectCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "subject_ref"))
    return (SubjectCanvas *) dict_get(read_id(st), "subject", canvas);
  else if (!strcmp(k, "subject")) {
    int id = read_id(st);
    SubjectCanvas * result = new SubjectCanvas(canvas, 0, 0, id);
    
    result->name = toUnicode(read_string(st));
    
    k = read_keyword(st);
    read_color(st, "color", result->itscolor, k);
    
    if (strcmp(k, "xyzwh"))
      wrong_keyword(k, "xyzwh");
    
    read_xyzwh(st, result);
    result->check_size();
    result->width_scale100 = result->width();
    result->height_scale100 = result->height();
    result->set_center100();
    result->show();
    return result;
  }
  else
    return 0;
}
开发者ID:SciBoy,项目名称:douml,代码行数:27,代码来源:SubjectCanvas.cpp

示例6: return

NoteCanvas * NoteCanvas::read(char *& st, UmlCanvas * canvas, char * k)
{
    if (!strcmp(k, "note_ref"))
        return (NoteCanvas *) dict_get(read_id(st), "note", canvas);
    else if (!strcmp(k, "note")) {
        int id = read_id(st);
        NoteCanvas * result = new NoteCanvas(canvas, 0, 0, id);

        result->read_internal(st);
        return result;
    }
    else
        return 0;
}
开发者ID:harmegnies,项目名称:douml,代码行数:14,代码来源:NoteCanvas.cpp

示例7: wd_fdc_seek_verify_read_id

static void
wd_fdc_seek_verify_read_id( wd_fdc *f )
{
  fdd_t *d = f->current_drive;
  int i;
  f->read_id = 1;

  event_remove_type( fdc_event );
  if( f->id_mark == WD_FDC_AM_NONE ) {
    while( f->rev ) {
      i = d->disk.i >= d->disk.bpt ? 0 : d->disk.i;	/* start position */
      if( !read_id( f ) ) {
	if( f->id_track != f->track_register ) {
	  f->status_register |= WD_FDC_SR_RNF;
	}
      } else
        f->id_mark = WD_FDC_AM_NONE;
      i = d->disk.bpt ? ( d->disk.i - i ) * 200 / d->disk.bpt : 200;
      if( i > 0 ) {
        event_add_with_data( tstates + i *		/* i * 1/20 revolution */
			   machine_current->timings.processor_speed / 1000,
			   fdc_event, f );
        return;
      } else if( f->id_mark != WD_FDC_AM_NONE )
        break;
    }
    if( f->id_mark == WD_FDC_AM_NONE )
      f->status_register |= WD_FDC_SR_RNF;
  }
  f->state = WD_FDC_STATE_NONE;
  f->status_register &= ~WD_FDC_SR_BUSY;
  wd_fdc_set_intrq( f );
  f->read_id = 0;
}
开发者ID:vamposdecampos,项目名称:fuse-emulator-svn,代码行数:34,代码来源:wd_fdc.c

示例8: start_read_diag

static void
start_read_diag( upd_fdc *f )
{
  int i;
  
  if( !f->read_id ) {
    f->rev = 2;
    f->read_id = 1;
  }
  if( f->rev ) {
    i = f->current_drive->disk.i >= f->current_drive->disk.bpt ?
    	0 : f->current_drive->disk.i;			/* start position */
    if( read_id( f ) != 2 )
      f->rev = 0;
    i = f->current_drive->disk.bpt ? 
      ( f->current_drive->disk.i - i ) * 200 / f->current_drive->disk.bpt : 200;
    if( i > 0 ) {
      event_add_with_data( tstates + i *		/* i * 1/20 revolution */
			 machine_current->timings.processor_speed / 1000,
			 fdc_event, f );
      return;
    }
  }
  f->read_id = 0;
  if( f->id_mark == UPD_FDC_AM_NONE ) {
    f->status_register[0] |= UPD_FDC_ST0_INT_ABNORM;
    f->status_register[1] |= UPD_FDC_ST1_EOF_CYLINDER;
    goto abort_read_diag;
  }
  if( f->id_track != f->data_register[1] || f->id_sector != f->data_register[3] || 
    f->data_register[2] != f->id_head ) {
    f->status_register[1] |= UPD_FDC_ST1_NO_DATA;
  }

  if( f->id_track != f->data_register[1] ) {		/*FIXME UPD765 set it always? */
    f->status_register[2] |= UPD_FDC_ST2_WRONG_CYLINDER;
    if( f->id_track == 0xff )
      f->status_register[2] |= UPD_FDC_ST2_BAD_CYLINDER;
  }

  if( read_datamark( f ) > 0 ) {	/* not found */
    f->status_register[0] |= UPD_FDC_ST0_INT_ABNORM;
    goto abort_read_diag;
  }

  f->main_status |= UPD_FDC_MAIN_DATAREQ | UPD_FDC_MAIN_DATA_READ;
  f->data_offset = 0;
  event_remove_type( timeout_event );
  event_add_with_data( tstates + 4 *			/* 2 revolution: 2 * 200 / 1000  */
		       machine_current->timings.processor_speed / 10,
		       timeout_event, f );
  return;

abort_read_diag:
    f->state = UPD_FDC_STATE_RES;	/* end of execution phase */
    f->cycle = f->cmd->res_length;
    f->main_status &= ~UPD_FDC_MAIN_EXECUTION;
    f->intrq = UPD_INTRQ_RESULT;
    cmd_result( f );
}
开发者ID:jacadym,项目名称:fuse-emulator,代码行数:60,代码来源:upd_fdc.c

示例9: read_val

/* Read out a given typed element */
static jvalue
read_val(unsigned char **pp, HprofType ty)
{
    jvalue        val;
    static jvalue empty_val;

    val = empty_val;
    switch ( ty ) {
        case 0:
        case HPROF_ARRAY_OBJECT:
        case HPROF_NORMAL_OBJECT:
            val.i = read_id(pp);
            break;
        case HPROF_BYTE:
        case HPROF_BOOLEAN:
            val.b = read_u1(pp);
            break;
        case HPROF_CHAR:
        case HPROF_SHORT:
            val.s = read_u2(pp);
            break;
        case HPROF_FLOAT:
        case HPROF_INT:
            val.i = read_u4(pp);
            break;
        case HPROF_DOUBLE:
        case HPROF_LONG:
            val.j = read_u8(pp);
            break;
        default:
            HPROF_ERROR(JNI_TRUE, "bad type number");
            break;
    }
    return val;
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:36,代码来源:hprof_check.c

示例10: seek_id

static int
seek_id( upd_fdc *f )
{
  int r;

  f->status_register[2] &= ~( UPD_FDC_ST2_WRONG_CYLINDER |
			      UPD_FDC_ST2_BAD_CYLINDER );
  r = read_id( f );
  if( r != 0 ) return r;		/* not found any good id */

  if( f->id_track != f->data_register[1] ) {
    f->status_register[2] |= UPD_FDC_ST2_WRONG_CYLINDER;
    if( f->id_track == 0xff )
      f->status_register[2] |= UPD_FDC_ST2_BAD_CYLINDER;
    return 3;
  }

  if( f->id_sector == f->data_register[3] && 
      f->id_head == f->data_register[2] ) {

    if( f->id_length != f->data_register[4] ) {
      f->status_register[1] |= UPD_FDC_ST1_NO_DATA;
      return 3;
    }

    return 0;
  }
  f->status_register[1] |= UPD_FDC_ST1_NO_DATA;
  return 3;
}
开发者ID:jacadym,项目名称:fuse-emulator,代码行数:30,代码来源:upd_fdc.c

示例11: ack_skip

    static size_t ack_skip(Buffer& buf)
    {
      const size_t len = buf.pop_front();
      for (size_t i = 0; i < len; ++i)
	read_id(buf);
      return len;
    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:7,代码来源:relack.hpp

示例12: return

StereotypePropertiesCanvas *
StereotypePropertiesCanvas::read(char *& st, UmlCanvas * canvas, char * k)
{
    if (!strcmp(k, "stereotypeproperties_ref"))
        return (StereotypePropertiesCanvas *) dict_get(read_id(st), "stereotypeproperties", canvas);
    else
        return 0;
}
开发者ID:harmegnies,项目名称:douml,代码行数:8,代码来源:StereotypePropertiesCanvas.cpp

示例13: return

SdDurationCanvas * SdDurationCanvas::read(char * & st, UmlCanvas * canvas, char * k)
{
  if (!strcmp(k, "durationcanvas_ref"))
    return ((SdDurationCanvas *) dict_get(read_id(st), "durationcanvas", canvas));
  else if (!strcmp(k, "durationcanvas")) {
    int id = read_id(st);
    SdObjCanvas * o;
    
    k = read_keyword(st);
    
    if ((o = SdClassInstCanvas::read(st, canvas, k)) == 0)
      wrong_keyword(st, k);
    
    return read_internal(st, canvas, id, o->get_life_line());
  }
  else
    return 0;
}
开发者ID:kralf,项目名称:bouml,代码行数:18,代码来源:SdDurationCanvas.cpp

示例14: read

    // copy ACKs from buffer to self
    void read(Buffer& buf)
    {
      const size_t len = buf.pop_front();
      for (size_t i = 0; i < len; ++i)
	{
	  const id_t id = read_id(buf);
	  data.push_back(id);
	}
    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:10,代码来源:relack.hpp

示例15: ack

    static size_t ack(REL_SEND& rel_send, Buffer& buf, const bool live)
    {
      const size_t len = buf.pop_front();
      for (size_t i = 0; i < len; ++i)
	{
	  const id_t id = read_id(buf);
	  if (live)
	    rel_send.ack(id);
	}
      return len;
    }
开发者ID:akoshelnik,项目名称:openvpn3,代码行数:11,代码来源:relack.hpp


注:本文中的read_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。