model_server/driver_aset/src/driver.cxx
// insert object at specified oper point
insert object at specified oper point
insert object at specified oper point
void driver::insert_at (OperPoint *pt, appTreePtr obj)
  {
  Initialize(driver::insert_at);
  if (!pt)
      return;
  appTreePtr appt = pt->node;
  if (!appt)
      return;
  appPtr hd = checked_cast(app,appt->get_header());
  if ( !hd )
     return;
  if ( is_smtHeader( hd ) )
      (checked_cast(smtHeader,hd))->suspend_parsing();
  start_transaction() {
    if ( is_smtTree( obj ) && is_smtTree( appt ) ) 
 	obj_insert(hd, pt->type, obj, appt, NULL, (void *)pt);
    else if (is_steTextNode(appt))
      {
      appTreePtr new_obj = obj->app_to_ste (); 
      if(new_obj)
 	obj_insert(hd, pt->type, new_obj, appt, NULL, (void *)pt);
      else
	{
	ostrstream s;
        if ( is_smtTree( obj ) ){
           s << "\n\n";
           ste_smt_send_native( checked_cast(smtTree,obj), s);
        }else
	    obj->send_string(s);
	s << ends;
	char * txt = s.str();
 	obj_insert(hd, pt->type, 0, appt, txt, (void *)pt);
	delete txt;
	}
      }
    else if (is_smtTree (appt))
      {
      if (is_smtRefNode(obj))
        {
	insert_reference_at_smt (pt, obj);
	return;
	}
      viewTreePtr vn = checked_cast(viewTree, pt->view_node);
      if (vn)
        {
	view *vw = get_view_header (vn);
	if (!is_smtTree (obj))
	  {
	  ostrstream s;
	  obj->send_string (s);
	  s << ends;
	  char *buf = s.str();
          obj_insert (checked_cast(app,appt->get_header()), pt->type, NULL, appt, buf);
	  if (buf) delete buf;
	  }
        else
	  {
	  obj = checked_cast(appTree,obj->get_first());	
          obj_insert (checked_cast(app,appt->get_header()), pt->type, obj, appt, 0);
	  }
	}
      }
    else
      obj_insert (checked_cast(app,appt->get_header()), pt->type, obj, appt, NULL);
    }
  end_transaction();
  }
void driver :: insert_at ( OperPoint * pt , appTreePtr obj ) { Initialize ( driver :: insert_at ) ; if ( ! pt ) return ; appTreePtr appt = pt -> node ; if ( ! appt ) return ; appPtr hd = checked_cast ( app , appt -> get_header ( ) ) ; if ( ! hd ) return ; if ( is_smtHeader ( hd ) ) ( checked_cast ( smtHeader , hd ) ) -> suspend_parsing ( ) ; start_transaction ( ) { if ( is_smtTree ( obj ) && is_smtTree ( appt ) ) obj_insert ( hd , pt -> type , obj , appt , NULL , ( void * ) pt ) ; else if ( is_steTextNode ( appt ) ) { appTreePtr new_obj = obj -> app_to_ste ( ) ; if ( new_obj ) obj_insert ( hd , pt -> type , new_obj , appt , NULL , ( void * ) pt ) ; else { ostrstream s ; if ( is_smtTree ( obj ) ) { s << " \n \n " ; ste_smt_send_native ( checked_cast ( smtTree , obj ) , s ) ; } else obj -> send_string ( s ) ; s << ends ; char * txt = s . str ( ) ; obj_insert ( hd , pt -> type , 0 , appt , txt , ( void * ) pt ) ; delete txt ; } } else if ( is_smtTree ( appt ) ) { if ( is_smtRefNode ( obj ) ) { insert_reference_at_smt ( pt , obj ) ; return ; } viewTreePtr vn = checked_cast ( viewTree , pt -> view_node ) ; if ( vn ) { view * vw = get_view_header ( vn ) ; if ( ! is_smtTree ( obj ) ) { ostrstream s ; obj -> send_string ( s ) ; s << ends ; char * buf = s . str ( ) ; obj_insert ( checked_cast ( app , appt -> get_header ( ) ) , pt -> type , NULL , appt , buf ) ; if ( buf ) delete buf ; } else { obj = checked_cast ( appTree , obj -> get_first ( ) ) ; obj_insert ( checked_cast ( app , appt -> get_header ( ) ) , pt -> type , obj , appt , 0 ) ; } } } else obj_insert ( checked_cast ( app , appt -> get_header ( ) ) , pt -> type , obj , appt , NULL ) ; } end_transaction ( ) ; }
insert object at specified oper point
insert object at specified oper point
//	obj_delete(obj); // Faild to convert to ste node; //	  obj_delete (obj); // go to real root