void vro_cpyfm(WORD wr_mode, WORD *pxyarray, FDB *psrcMFDB, FDB *pdesMFDB) { intin[0] = wr_mode; i_ptr( psrcMFDB ); i_ptr2( pdesMFDB ); i_ptsin( pxyarray ); gsx_ncode(COPY_RASTER_FORM, 4, 1); i_ptsin( ptsin ); }
void vr_recfl(WORD *pxyarray, FDB *pdesMFDB) { //gemdos(9,"Mysterious vr_recfl\r\n"); i_ptr( pdesMFDB ); i_ptsin( pxyarray ); gsx_ncode(FILL_RECTANGLE, 2, 1); i_ptsin( ptsin ); //gemdos(9,"vr_recfl done\r\n"); }
void vrt_cpyfm(WORD wr_mode, WORD *pxyarray, FDB *psrcMFDB, FDB *pdesMFDB, WORD fgcolor, WORD bgcolor) { intin[0] = wr_mode; intin[1] = fgcolor; intin[2] = bgcolor; i_ptr( psrcMFDB ); i_ptr2( pdesMFDB ); i_ptsin( pxyarray ); gsx_ncode(121, 4, 3); i_ptsin( ptsin ); }
int main() { //Create three instances of the template double(* d_ptr)(double *) = addAll<double,10>; int(* i_ptr)(int *) = addAll<int,10>; Number(* n_ptr)(Number *) = addAll<Number,10>; double darray[10] = {1,2,3,4,5,6,7,8,9,10}; double resultOne = d_ptr(darray); std::cout << "First total is: " << resultOne << std::endl; int iarray[10] = {1,2,3,4,5,6,7,8,9,10}; int resultTwo = i_ptr(iarray); std::cout << "Second total is: " << resultTwo << std::endl; Number numbers[] = {1,2,3,4,5,6,7,8,9,10}; Number resultThree = n_ptr(numbers); std::cout << "Third total is: " << resultThree << std::endl; }
void vrn_trnfm(FDB *psrcMFDB, FDB *pdesMFDB) { i_ptr( psrcMFDB ); i_ptr2( pdesMFDB ); gsx_ncode(TRANSFORM_FORM, 0, 0); }
TEUCHOS_UNIT_TEST( GetBaseObjVoidPtr, nonPolymorphicBuiltInTypes ) { RCP<int> i_ptr(new int); TEST_EQUALITY( getBaseObjVoidPtr(&*i_ptr), static_cast<const void*>(&*i_ptr) ); }
int main(){ typedef atomic_markable_reference<std::string> amr; typedef amr::pair_ptr pair_ptr; std::cout << "starting testing...\n"; // std::string* s1 = new std::string("hello"); //std::string* s2 = new std::string("bye"); amr::shared_ptr s1 = amr::shared_ptr(new std::string("hello")); amr::shared_ptr s2 = amr::shared_ptr(new std::string("bye")); amr a(s1,false); //make sure initial values are right pair_ptr rp = a.get_pair(); assert(rp->first==s1 && rp->second == false ); bool done = a.compare_and_set(rp,s2,true); assert(done); //make sure new values are right rp = a.get_pair(); assert(rp->first==s2 && rp->second == true ); bool marked = a.attempt_mark(s2,false); assert(marked); rp = a.get_pair(); assert(rp->first ==s2 && rp->second == false ); //test the get call bool mark = true; amr::shared_ptr s3 = a.get(mark); assert( !mark && s3 == s2); //test convinience compare and set done = a.compare_and_set(s2,false,s1,true); assert(done); rp = a.get_pair(); assert(rp->first ==s1 && rp->second == true ); //test with null ptr { amr::shared_ptr p; done = a.compare_and_set(s1,true,p,false); assert(done); rp = a.get_pair(); assert(rp->first ==p && rp->second == false ); assert(!p); } mark = true; amr::shared_ptr p2 = a.get(mark); assert(!p2); assert(!mark); //test shared_ptr arrays boost::shared_ptr<int> i_ptr(new int(5)); boost::shared_ptr<int> ptrs[5]; ptrs[0] = i_ptr; ptrs[1] = i_ptr; assert(ptrs[0] == i_ptr); assert(ptrs[0] == ptrs[1]); assert( *ptrs[0] == 5); //test on array amr::shared_ptr s_ptr(new std::string("h")); boost::shared_ptr<amr> a_ptr(new amr(s_ptr,false)); boost::shared_ptr<amr> ptr_arr[5]; ptr_arr[0] = a_ptr; ptr_arr[1] = a_ptr; assert(ptr_arr[0] == a_ptr); assert( ptr_arr[0]->get_ref() == s_ptr ); std::cout << "tests passed" << std::endl; return 0; }