int test_main( int, char *[] )  
{
	Derived_A a;
	Derived_A_1 a1;
	Derived_B b;
	
	Base const& cba=a;
	Base const& cbb=b;
	Base const& cba1=a1;
	
	BOOST_CHECK	(	is_A(cba)	);
	BOOST_CHECK	( !	is_A(cbb)	);
	BOOST_CHECK (	is_A(cba1)	); 	

	return 0;
}
Exemple #2
0
/* convert a 'raw' of DNAbin object to char */
char DNAbin2char(unsigned char in){
    if(is_A(in)) return 'a';
    if(is_G(in)) return 'g';
    if(is_T(in)) return 't';
    if(is_C(in)) return 'c';
    return '-';
}
void parser::parse(string ins)
{
  ins=trim(ins); //remove spaces
  if(is_A(ins))
  { 
     string tmp=ins.substr(1);   //get rid of '@'
     size_t found = tmp.find_first_not_of("0123456789"); 
     if(found==string::npos)  //number
 	this->number = stol(tmp);      
     else  //symbols         
 	symbol=tmp;
  }
  else if (is_C(ins))
  {
      size_t x=ins.find_first_of("=;");
      if(ins[x]=='=')   //if there is =(equal) part
      {
        size_t len=x-0;
	dest=ins.substr(0, len);   //in case of dest = comp ; jump
	size_t first_semi_colon=ins.find_first_of(";");
	if(first_semi_colon!=string::npos)   //we found semi colon so there is jump
	{
	   len = first_semi_colon - x -1;
	   comp=ins.substr(x+1,len);
           jump=ins.substr(first_semi_colon+1);
        }
        else    //no jump part
        {
           comp=ins.substr(x+1);
        }	   
      }
      if(ins[x]==';')  //if no equal part
      {
        size_t len=x-0;
	comp=ins.substr(0,len);
	jump=ins.substr(x+1);
      }	
  }
  else   //label
  {
   
  }
}