main(int argc, char *argv[]){ /** Check the number of parameters */ if (argc < 3) { /** Tell the user how to run the program */ cerr << "Usage: " << argv[0] << " num_col key_file" << endl; return 1; } mr_init_threading(); PFC pfc(AES_SECURITY); SecureSelect *db=NULL; int m=atoi(argv[1]); string key_name(argv[2]); db = new SecureSelect(m,&pfc,pfc.order()); #ifdef VERBOSE int start = getMilliCount(); #endif db->KeyGen(key_name); #ifdef VERBOSE int milliSecondsElapsed = getMilliSpan(start); cout << "\texec time " << milliSecondsElapsed << endl; #endif }
main(int argc, char *argv[]){ /** Check the number of parameters */ if (argc < 5) { /** Tell the user how to run the program */ cerr << "Usage: " << argv[0] << " token encrows results num_threads" << endl; return 1; } mr_init_threading(); PFC pfc(AES_SECURITY); SecureSelect *db=NULL; int m=0; string query_name(argv[1]); string enctable_name(argv[2]); string results_name(argv[3]); int num_threads = atoi(argv[4]); db = new SecureSelect(&pfc,pfc.order()); if (!ifstream(query_name+"_ptok")){ cout << "Query file doesn't exist" << endl; return 0; } if (!ifstream(enctable_name+"_enc_msgs")){ cout << "Enctable file doesn't exist" << endl; return 0; } #ifdef VERBOSE int start = getMilliCount(); #endif int res_num = db->ApplyPTokenMT(query_name, enctable_name, results_name, num_threads); //int res_num = db->ApplyPToken(query_name, enctable_name, results_name); #ifdef VERBOSE int milliSecondsElapsed = getMilliSpan(start); cout << "\texec time " << milliSecondsElapsed << endl; #endif if(res_num >=0){ cout << res_num << " result(s) found" << endl; return 1; } else return 0; }
main(int argc, char *argv[]){ /** Check the number of parameters */ if (argc < 6) { /** Tell the user how to run the program */ cerr << "Usage: " << argv[0] << " key_file rows encrows noise num_threads" << endl; return 1; } /** Set the random seed for noise parameter generation */ srand(time(NULL)); mr_init_threading(); PFC pfc(AES_SECURITY); SecureSelect *db=NULL; int m=0; string key_file(argv[1]); string table_name(argv[2]); string enctable_name(argv[3]); int rand_lim = atoi(argv[4]); int num_threads = atoi(argv[5]); db = new SecureSelect(&pfc,pfc.order()); if(!db->LoadKey(key_file)) return 0; if(rand_lim<1){ cout << "Random paramter < 1, it has to be >= 1" << endl; return 0; } #ifdef VERBOSE int start = getMilliCount(); #endif db->EncryptRowsMT(table_name,enctable_name,rand_lim, num_threads); // db->EncryptRows(table_name,enctable_name,rand_lim); #ifdef VERBOSE int milliSecondsElapsed = getMilliSpan(start); cout << "\texec time " << milliSecondsElapsed << endl; #endif }
static void libusbCallback(struct libusb_transfer* transfer) { if (start == 0) { start = getMilliCount(); count = 0; } else { if (getMilliSpan(start) > 1000) { printf("%f bytes / second\n", (float)count / 1.0); start = getMilliCount(); count = 0; } } count += transfer->actual_length; libusb_submit_transfer(transfer); }
void RenderGL(void) { //t1.start(); //============ //countFrames ++; //============ //======================================================================================================================= //================================================================= #ifdef __APPLE__ //-------------- //eyeposition[0] -= PassTouchMovement[0]; //eyeposition[1] -= PassTouchMovement[1]; //eyeposition[2] -= PassTouchMovement[2]; //PassTouchMovement[0] = 0.0; //PassTouchMovement[1] = 0.0; //PassTouchMovement[2] = 0.0; //-------------- #endif //================================================================= //================================================================= #ifdef WIN32 //------------ rotateModelWithMiddleMouse[0] = Pass_MIDDLE_Mouse[0]; rotateModelWithMiddleMouse[1] = Pass_MIDDLE_Mouse[1]; //------------------------------------------------------- zoomModelWithMiddleMouse = Pass_MIDDLE_CONTROL_Mouse; //------------------------------------------------------- moveModelWithMiddleMouse[0] = Pass_MIDDLE_SHIFT_Mouse[0]; moveModelWithMiddleMouse[1] = Pass_MIDDLE_SHIFT_Mouse[1]; //------------ #endif //================================================================= //============================================================================================================================ //turnTable += 0.1; //==================================================================================================================================== ///////////////________FRAMEBUFFER_SHADOWS_BEGINS_HERE______________FRAMEBUFFER_SHADOWS_BEGINS_HERE___________________________________ ///////////////________FRAMEBUFFER_SHADOWS_BEGINS_HERE______________FRAMEBUFFER_SHADOWS_BEGINS_HERE___________________________________ //==================================================================================================================================== glEnable(GL_DEPTH_TEST); glDepthMask(1); glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); glDepthFunc(GL_LESS); glBindFramebuffer(GL_FRAMEBUFFER, m_uiFrameBufferObject); #include "runDepth_FBO.cpp" glBindFramebuffer(GL_FRAMEBUFFER, 0); //glDepthMask(0); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); //glDepthFunc(GL_EQUAL); //==================================================================================================================================== ///////////////________FRAMEBUFFER_SHADOWS_BEGINS_HERE______________FRAMEBUFFER_SHADOWS_BEGINS_HERE___________________________________ ///////////////________FRAMEBUFFER_SHADOWS_BEGINS_HERE______________FRAMEBUFFER_SHADOWS_BEGINS_HERE___________________________________ //==================================================================================================================================== glBindFramebuffer(GL_FRAMEBUFFER, normals_FBO);//normals_FBO //========================================== #include "drawNormalColor_FBO.cpp" //========================================== glBindFramebuffer(GL_FRAMEBUFFER, 0); //=============================================================================================================== //=============================================================================================================== /* glBindFramebuffer(GL_FRAMEBUFFER, softDiffuse_FBO);//softDiffuse_FBO_TEXTURE //========================================== shaderNumber = 5; #include "softDiffuse.cpp" //========================================== glBindFramebuffer(GL_FRAMEBUFFER, 0); */ //=============================================================================================================== //=============================================================================================================== glBindFramebuffer(GL_FRAMEBUFFER, drawMainColor_PRIMARY_FBO);//drawMainColor_PRIMARY_FBO_COLOR_TEXTURE, drawMainColor_PRIMARY_FBO_RAW_DEPTH_TEXTURE //========================================== #include "drawMainColor_FBO.cpp" //========================================== glBindFramebuffer(GL_FRAMEBUFFER, 0); /* //=============================================================================================================== //=============================================================================================================== glBindFramebuffer(GL_FRAMEBUFFER, hardEdgeShadow_TEXTURE); //hardEdgeShadow_TEXTURE //---------------------------------------------------------------- glActiveTexture (GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, drawMainColor_PRIMARY_FBO_COLOR_TEXTURE); shaderNumber = 1; //--------------- #include "_MODEL_FOLDERS_/frameBufferPlane/frameBufferPlane_RENDER.cpp" glBindFramebuffer(GL_FRAMEBUFFER, 0); //=============================================================================================================== */ //=======================_POWER_VR_BLUR_====================== //============================================================ scaleFrameBufferPlaneViewPort = scale_generic_FBO; //#include "_SHADERS/PowerVR_blur/PowerVR_blur_RENDER.cpp" //============================================================ //=======================_POWER_VR_BLUR_====================== //=======================_Radial_BLUR_==================== //============================================================ scaleFrameBufferPlaneViewPort = scale_generic_FBO; #include "_SHADERS/radial_blur/radial_blur_RENDER.cpp" //============================================================ //=======================_Radial_BLUR_==================== //=======================_Radial_OCC_==================== //============================================================ scaleFrameBufferPlaneViewPort = scale_radial_OCC_FBO; #include "_SHADERS/radial_occlusion/radial_occlusion_RENDER.cpp" //============================================================ //=======================_Radial_OCC_==================== //================================================================================================================================= //--------------------------------------------------------------------------------------------------------------------------------- //================================================================================================================================= #ifdef __APPLE__ //======================================================= if(iOS_MSAA_IS_ON) { glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer); }else { glBindFramebuffer(GL_FRAMEBUFFER, viewRenderbuffer); } #endif //================================================================= //==================================__FINAL_COMPOSITE__=============================== scaleFrameBufferPlaneViewPort = 1; //================================= glActiveTexture (GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, drawMainColor_PRIMARY_FBO_RAW_DEPTH_TEXTURE); //---------------------------- glActiveTexture (GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, radial_OCC_01_TEXTURE);//generic_04_TEXTURE //---------------------------- glActiveTexture (GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, drawMainColor_PRIMARY_FBO_COLOR_TEXTURE);// //--------------------------------------------------------------------- shaderNumber = 10; #include "_MODEL_FOLDERS_/frameBufferPlane/frameBufferPlane_RENDER.cpp" //==================================__FINAL_COMPOSITE__=============================== /* glBindFramebuffer(GL_FRAMEBUFFER, drawMainColor_FBO); const GLenum discards[] = {GL_COLOR_ATTACHMENT0,GL_DEPTH_ATTACHMENT}; glDiscardFramebufferEXT(GL_FRAMEBUFFER,2,discards); glBindFramebuffer(GL_FRAMEBUFFER, shadow_01_blur_HorizontalPass_fboId); const GLenum discards2[] = {GL_COLOR_ATTACHMENT0}; glDiscardFramebufferEXT(GL_FRAMEBUFFER,1,discards2); glBindFramebuffer(GL_FRAMEBUFFER, shadow_01_blur_VerticalPass_fboId); const GLenum discards3[] = {GL_COLOR_ATTACHMENT0}; glDiscardFramebufferEXT(GL_FRAMEBUFFER,1,discards3); */ //================================================================================================================================= //--------------------------------------------------------------------------------------------------------------------------------- //================================================================================================================================= //========================================================== //========================================================== //========================================================== milliSecondsElapsed = getMilliSpan(start); //-------------- #ifdef __APPLE__ NSLog(@"milliSecondsElapsed: %i", (int)milliSecondsElapsed); #endif //========================================================== //========================================================== //========================================================== LoadIdentity(moveSetMatrix); Translate(moveSetMatrix, moveSet[0], moveSet[1],moveSet[2]); marc_ROTATE[3] += 0.2; //ROOM_01_IS_ACTIVE = false; //============================================ // eyePosition = 0.0 if(eyePosition[1] >= -5.0 && eyePosition[1] <= 5.0) { room_01_IS_ACTIVE = true; } else { room_01_IS_ACTIVE = false; } //============================================ // eyePosition = -4.0 if(eyePosition[1] >= -9.0 && eyePosition[1] <= 1.0) { room_02_IS_ACTIVE = true; } else { room_02_IS_ACTIVE = false; } //============================================ // eyePosition = -8.0 if(eyePosition[1] >= -13.0 && eyePosition[1] <= -3.0) { room_03_IS_ACTIVE = true; } else { room_03_IS_ACTIVE = false; } //============================================ }//_END_RenderGL()//#####################################################################################################
int Timer::getDelta() { m_DeltaMilliseconds = getMilliSpan( m_MilliCount ); if( m_DeltaMilliseconds > 0 ) m_MilliCount = getMilliCount(); return m_DeltaMilliseconds; }
int Timer::getElapsed() { return getMilliSpan( m_MilliTimer ); }
Timer::Timer() { m_MilliTimer = getMilliCount(); m_MilliCount = getMilliCount(); m_DeltaMilliseconds = getMilliSpan( m_MilliCount ); }
void RenderGL(void) { frameStart = getMilliSpan(start); //======================================================================================================================= //================================================================= #if defined (__APPLE__) && TARGET_OS_IPHONE == 1 //-------------- //eyePosition[0] -= PassTouchMovement[0]; //eyePosition[1] -= PassTouchMovement[1]; //eyePosition[2] -= PassTouchMovement[2]; //PassTouchMovement[0] = 0.0; //PassTouchMovement[1] = 0.0; //PassTouchMovement[2] = 0.0; //-------------- #endif //================================================================= //================================================================= // #ifdef WIN32 //------------ rotateModelWithMiddleMouse[0] = Pass_MIDDLE_Mouse[0]; rotateModelWithMiddleMouse[1] = Pass_MIDDLE_Mouse[1]; //------------------------------------------------------- zoomModelWithMiddleMouse = Pass_MIDDLE_CONTROL_Mouse; //------------------------------------------------------- moveModelWithMiddleMouse[0] = Pass_MIDDLE_SHIFT_Mouse[0]; moveModelWithMiddleMouse[1] = Pass_MIDDLE_SHIFT_Mouse[1]; //------------ //#endif //================================================================= //============================================================== //turnTable += 0.1; LoadIdentity(moveSetMatrix); //Translate(moveSetMatrix, moveSet[0], moveSet[1],moveSet[2]); //============================================================== runDepth_PASS(); //============================================================== //======================================================================== //-------------------------------___iOS___-------------------------------- //======================================================================== #if defined (__APPLE__) && TARGET_OS_IPHONE == 1 if(iOS_MSAA_IS_ON) { glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer); }else { glBindFramebuffer(GL_FRAMEBUFFER, viewRenderbuffer); } #endif //======================================================================== //-------------------------------___iOS___-------------------------------- //======================================================================== GLuint RenderLocator = 0; runColor_PASS(); //============================================================== //================================== frameEnd = getMilliSpan(start); frameTime = frameEnd - frameStart; #if defined (__APPLE__) NSLog(@"frameTime = %i milliseconds", (int)frameTime); #endif }//_END_RenderGL()//#####################################################################################################